Changeset 3188916
- Timestamp:
- 11/14/2024 05:27:57 PM (5 months ago)
- Location:
- disabled-source-disabled-right-click-and-content-protection
- Files:
-
- 119 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
disabled-source-disabled-right-click-and-content-protection/trunk/disabled-source-and-content-protection.php
r3162601 r3188916 4 4 * Plugin URI: https://wordpress.org/plugins/disabled-source-disabled-right-click-and-content-protection/ 5 5 * Description: Disabled Source(Ctrl+U), Disabled Right click, Disable F12 functional key, and Disable save the page(Ctrl+S) and Content Protection of your WordPress Website. 6 * Version: 1.4. 66 * Version: 1.4.7 7 7 * Requires at least: 4.7 8 8 * Tested up to: 6.6 -
disabled-source-disabled-right-click-and-content-protection/trunk/includes/admin/options/global.php
r3152545 r3188916 31 31 } 32 32 33 33 // Post Type 34 if ( ! function_exists( 'disable_get_all_post_type' ) ) { 35 function disable_get_all_post_type() { 36 $all_post_types = get_option('jh_disable_post_types'); 37 return $all_post_types; 38 } 39 } 34 40 35 41 if( class_exists( 'CSF' ) ) { … … 38 44 39 45 CSF::createOptions( $prefix, array( 40 'framework_title' => __( 'Disabled Settings <a style="text-decoration:none; background: #2271b1; padding: 5px 10px; display: inline-block;border-radius: 8px;color: #fff;font-size: 16px;" href="https://buymeacoffee.com/jahidcmt4" target="_blank"><i class="fa fa-coffee" aria-hidden="true"></i> Buy Me a Coffee</a>', 'disabled-source-disabled-right-click-and-content-protection' ),46 'framework_title' => __( 'Disabled Settings', 'disabled-source-disabled-right-click-and-content-protection' ), 41 47 'menu_title' => __( 'Disabled Settings', 'disabled-source-disabled-right-click-and-content-protection' ), 42 48 'menu_slug' => 'disabled-source-disabled-right-click-and-content-protection', … … 445 451 ) ); 446 452 453 // Disable By Post Type 454 CSF::createSection( $prefix, array( 455 'title' => __( 'Disable By Post Type', 'disabled-source-disabled-right-click-and-content-protection' ), 456 'fields' => array( 457 array( 458 'id' => 'disable-post-type', 459 'type' => 'select', 460 'title' => __( 'Disable By Post Type', 'disabled-source-disabled-right-click-and-content-protection' ), 461 'options' => function_exists( 'disable_get_all_post_type' ) ? disable_get_all_post_type() : '', 462 'chosen' => true, 463 'multiple' => true, 464 'placeholder' => "If left empty, it will affect all post type.", 465 ), 466 ) 467 ) ); 468 447 469 } -
disabled-source-disabled-right-click-and-content-protection/trunk/includes/functions/functions.php
r3162601 r3188916 37 37 $jhdoption = get_option( 'jh_disabled_option' ); 38 38 if (!is_user_logged_in() ){ 39 if( apply_filters( 'jh_disable_pages_permission', $pages_permission = '') ){39 if( apply_filters( 'jh_disable_pages_permission', $pages_permission = '') && apply_filters( 'jh_disable_post_type_permission', $post_type_permission = '') ){ 40 40 41 41 if( !empty($jhdoption['disabled-content-select']) && $jhdoption['disabled-content-select']=="1" ){ … … 65 65 }else{ 66 66 if( apply_filters( 'jh_disable_roles_permission', $roles_permission = '')){ 67 if( apply_filters( 'jh_disable_pages_permission', $pages_permission = '') ){67 if( apply_filters( 'jh_disable_pages_permission', $pages_permission = '') && apply_filters( 'jh_disable_post_type_permission', $post_type_permission = '') ){ 68 68 69 69 if( !empty($jhdoption['disabled-content-select']) && $jhdoption['disabled-content-select']=="1" ){ … … 255 255 $jhdoption = get_option( 'jh_disabled_option' ); 256 256 $permission_pages = !empty($jhdoption['disable-pages']) ? $jhdoption['disable-pages'] : ['all']; 257 $permission_post_types = !empty($jhdoption['disable-post-type']) ? $jhdoption['disable-post-type'] : ''; 257 258 258 259 if ( $permission_pages === ['all'] ) { … … 262 263 return true; 263 264 }else{ 264 return false; 265 if( empty($permission_post_types) && is_single() ){ 266 return true; 267 }elseif( !empty($permission_post_types) && is_single() ){ 268 if( in_array(get_post_type(), $permission_post_types)){ 269 return true; 270 }else{ 271 return false; 272 } 273 }else{ 274 return false; 275 } 265 276 } 266 277 }else{ … … 275 286 return true; 276 287 }else{ 288 if( empty($permission_post_types) && is_single() ){ 289 return true; 290 }elseif( !empty($permission_post_types) && is_single() ){ 291 if( in_array(get_post_type(), $permission_post_types)){ 292 return true; 293 }else{ 294 return false; 295 } 296 }else{ 297 return false; 298 } 299 } 300 } 301 } 302 } 303 304 // Permission by post type 305 add_filter('jh_disable_post_type_permission', 'jh_disable_post_type_permission_callback'); 306 function jh_disable_post_type_permission_callback($post_type_permission){ 307 $jhdoption = get_option( 'jh_disabled_option' ); 308 $permission_post_types = !empty($jhdoption['disable-post-type']) ? $jhdoption['disable-post-type'] : ''; 309 310 if ( is_single() ){ 311 312 if(!empty($permission_post_types)){ 313 if( in_array(get_post_type(), $permission_post_types)){ 314 return true; 315 }else{ 277 316 return false; 278 317 } 279 } 280 } 318 }else{ 319 return true; 320 } 321 322 }else{ 323 return true; 324 } 325 } 326 327 add_action( 'admin_init', 'jh_disable_check_frontend_post_types' ); 328 function jh_disable_check_frontend_post_types() { 329 $post_types = get_post_types( 330 array( 331 'public' => true, 332 'publicly_queryable' => true 333 ), 334 'objects' 335 ); 336 $all_post_types = []; 337 if(!empty($post_types)){ 338 unset( $post_types['attachment'] ); 339 foreach ( $post_types as $post_type ) { 340 $all_post_types[ $post_type->name ] = $post_type->label; 341 } 342 } 343 344 // Retrieve the current saved option value 345 $current_saved_value = get_option('jh_disable_post_types'); 346 347 // Only update if there is a difference 348 if ($current_saved_value !== $all_post_types) { 349 update_option('jh_disable_post_types', $all_post_types); 350 } 281 351 } 282 352 -
disabled-source-disabled-right-click-and-content-protection/trunk/readme.txt
r3162601 r3188916 4 4 Requires at least: 4.7 5 5 Tested up to: 6.6 6 Stable tag: 1.4. 66 Stable tag: 1.4.7 7 7 Requires PHP: 5.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 Donate link: https://buymeacoffee.com/jahidcmt411 10 12 11 Disable Source(Ctrl+U), Disable Right click, Disable F12 functional key, and Disable save the page(Ctrl+S) and Content Protection of your WordPress Website. … … 15 14 16 15 Disabled Source, Disabled Right Click, and Content Protection is a very simple plugin to Protect your Website Content, Disable view page source(Ctrl+U), Disable Right Click, Disable F12 functional key, and Disable save the page(Ctrl+S). The special thing is you to allow or disallow your post comments/review section. 17 18 👉 Join Our [Facebook Group](https://www.facebook.com/groups/content.protection).19 16 20 17 The plugin is called copy content protection. It is very easy to use and install. This plugin protects content both on PC and mobile devices. Our latest features block IP Addresses. … … 49 46 * Disable by Page id 50 47 * Disable by Role wise 51 * Disable by Post Type (upcoming)48 * Disable by Post Type 52 49 53 50 = 🎉 Disable Comments = … … 111 108 == Changelog == 112 109 110 = 1.4.7 = 111 112 * Added: Block by post type 113 113 114 = 1.4.6 = 114 115
Note: See TracChangeset
for help on using the changeset viewer.