Skip to content

Commit 42f4550

Browse files
authored
Create llms-skip-copy-paste-protection-on-certain-pages.php
1 parent 87b1a83 commit 42f4550

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Example for avoiding copy/pasting on certain page IDs.
4+
*
5+
* See https://lifterlms.com/docs/how-do-i-add-custom-code-to-lifterlms/ for how to use snippets like this.
6+
*/
7+
function my_disable_copy_protection( $allow_copying ) {
8+
if ( ! $allow_copying && in_array( get_the_ID(), array( 123, 456 ) ) {
9+
$allow_copying = true;
10+
}
11+
12+
return $allow_copying;
13+
}
14+
add_filter( 'llms_skip_content_prevention', 'my_disable_copy_protection' );

0 commit comments

Comments
 (0)