Plugin Directory

Changeset 3188916


Ignore:
Timestamp:
11/14/2024 05:27:57 PM (5 months ago)
Author:
jahidcse
Message:

1.4.7

  • Added: Block by post type
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  
    44 * Plugin URI:        https://wordpress.org/plugins/disabled-source-disabled-right-click-and-content-protection/
    55 * 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.6
     6 * Version:           1.4.7
    77 * Requires at least: 4.7
    88 * Tested up to: 6.6
  • disabled-source-disabled-right-click-and-content-protection/trunk/includes/admin/options/global.php

    r3152545 r3188916  
    3131}
    3232
    33 
     33// Post Type
     34if ( ! 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}
    3440
    3541if( class_exists( 'CSF' ) ) {
     
    3844
    3945  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' ),
    4147    'menu_title'              =>   __( 'Disabled Settings', 'disabled-source-disabled-right-click-and-content-protection' ),
    4248    'menu_slug'               =>   'disabled-source-disabled-right-click-and-content-protection',
     
    445451  ) );
    446452
     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
    447469}
  • disabled-source-disabled-right-click-and-content-protection/trunk/includes/functions/functions.php

    r3162601 r3188916  
    3737    $jhdoption = get_option( 'jh_disabled_option' );
    3838    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 = '') ){
    4040
    4141            if( !empty($jhdoption['disabled-content-select']) && $jhdoption['disabled-content-select']=="1" ){
     
    6565    }else{
    6666        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 = '') ){
    6868               
    6969                if( !empty($jhdoption['disabled-content-select']) && $jhdoption['disabled-content-select']=="1" ){
     
    255255    $jhdoption = get_option( 'jh_disabled_option' );
    256256    $permission_pages = !empty($jhdoption['disable-pages']) ? $jhdoption['disable-pages'] : ['all'];
     257    $permission_post_types = !empty($jhdoption['disable-post-type']) ? $jhdoption['disable-post-type'] : '';
    257258   
    258259    if ( $permission_pages === ['all'] ) {
     
    262263            return true;
    263264        }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            }
    265276        }
    266277    }else{
     
    275286                return true;
    276287            }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
     305add_filter('jh_disable_post_type_permission', 'jh_disable_post_type_permission_callback');
     306function 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{
    277316                return false;
    278317            }
    279         }
    280     }
     318        }else{
     319            return true;
     320        }
     321       
     322    }else{
     323        return true;
     324    }
     325}
     326
     327add_action( 'admin_init', 'jh_disable_check_frontend_post_types' );
     328function 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  }
    281351}
    282352
  • disabled-source-disabled-right-click-and-content-protection/trunk/readme.txt

    r3162601 r3188916  
    44Requires at least: 4.7
    55Tested up to: 6.6
    6 Stable tag: 1.4.6
     6Stable tag: 1.4.7
    77Requires PHP: 5.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    10 Donate link: https://buymeacoffee.com/jahidcmt4
    1110
    1211Disable Source(Ctrl+U), Disable Right click, Disable F12 functional key, and Disable save the page(Ctrl+S) and Content Protection of your WordPress Website.
     
    1514
    1615Disabled 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).
    1916
    2017The 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.
     
    4946* Disable by Page id
    5047* Disable by Role wise
    51 * Disable by Post Type(upcoming)
     48* Disable by Post Type
    5249
    5350= 🎉 Disable Comments =
     
    111108== Changelog ==
    112109
     110= 1.4.7 =
     111
     112* Added: Block by post type
     113
    113114= 1.4.6 =
    114115
Note: See TracChangeset for help on using the changeset viewer.