Plugin Directory

Changeset 1399882


Ignore:
Timestamp:
04/20/2016 03:21:34 AM (10 years ago)
Author:
arippberger
Message:

update plugin with new ‘restrict by default’ option

Location:
super-simple-post-page-restricor/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • super-simple-post-page-restricor/trunk/README.md

    r951353 r1399882  
    3939  - User roles selected here will **never** be able to see restricted content, regardless of whether they are logged in.
    4040
     41**Default restriction?**
     42
     43  - If this option is checked, posts / pages that are auto-generated should be restricted in most cases.
     44  - If this option is checked, newly created posts / pages should have their 'restrict content' checkboxes checked.
     45
    4146Future Development
    4247------------------
     
    4550
    4651  - Add shortcode to restrict content - content placed between start/end shortcodes would be restricted
    47   - Resctrict content in RSS feeds
     52  - Restrict content in RSS feeds
  • super-simple-post-page-restricor/trunk/README.txt

    r1332582 r1399882  
    11=== Super Simple Post / Page Restrictor ===
    2 Contributors: arippberger, werkpress
     2Contributors: arippberger
    33Tags: restrict content, restrictor, super simple, user login, login, restrict
    44Donate link: http://alecrippberger.com
    55Requires at least: 3.0.1
    6 Tested up to: 3.9.1
    7 Stable tag: 1.0
     6Tested up to: 4.5
     7Stable tag: 1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4848  - User roles selected here will **never** be able to see restricted content, regardless of whether they are logged in.
    4949
     50**Default restriction?**
     51
     52  - If this option is checked, posts / pages that are auto-generated should be restricted in most cases.
     53  - If this option is checked, newly created posts / pages should have their 'restrict content' checkboxes checked.
     54
    5055== Future Development ==
    5156
  • super-simple-post-page-restricor/trunk/super-simple-post-page-restrictor-options.php

    r1177974 r1399882  
    22if ( ! class_exists( 'Super_Simple_Post_Page_Options' ) ) {
    33    class Super_Simple_Post_Page_Options {
     4       
    45        /**
    56         * Holds the values to be used in the fields callbacks
    67         */
    78        private $options;
    8 
     9       
    910        /**
    1011         * Start up
     
    1516            add_action( 'add_meta_boxes', array( $this, 'add_post_restriction_checkbox' ) );
    1617            add_action( 'save_post', array( $this, 'save_post_restriction_checkbox' ), 13, 2 );
    17 
    18         }
    19 
     18           
     19        }
     20       
    2021        /**
    2122         * Setup checkbox meta
    2223         */
    2324        public function setup_post_restriction_checkbox() {
    24 
    25         }
    26 
     25           
     26        }
     27       
    2728        /**
    2829         * Add checkbox to posts/pages which will allow users to select whether a post/page should be restricted
    2930         */
    3031        public function add_post_restriction_checkbox() {
    31 
     32           
    3233            //get options
    3334            $this->options = get_option( 'ss_pp_restrictor_option' );
    34 
     35           
    3536            //get post types set on settings page
    36             $applicable_post_types = $this->options['post_type_select'];
    37 
     37            $applicable_post_types = $this->options[ 'post_type_select' ];
     38           
    3839            $post_types = get_post_types(); //get all post types
    39 
     40           
    4041            if ( is_array( $applicable_post_types ) && is_array( $post_types ) ) {
    4142                foreach ( $post_types as $post_type ) {
     
    5354            }
    5455        }
    55 
     56       
    5657        /**
    5758         * Display meta box.
    5859         */
    5960        public function post_restriction_checkbox( $object, $box ) {
    60 
     61           
    6162            wp_nonce_field( basename( __FILE__ ), 'post_restriction_checkbox_nonce' );
     63           
    6264            $checked = get_post_meta( $object->ID, 'ss_pp_restrictor_checkbox', true );
    63             //var_dump( $checked );
     65
     66            $restrict_by_default = isset( $this->options[ 'restrict_by_default' ] ) ? $this->options[ 'restrict_by_default' ] : false;
     67
     68            $checked = $restrict_by_default && $checked === '' ? true : false;
     69           
    6470            ?>
    6571            <p>
     
    7076                   value="1" <?php checked( $checked ); ?> />
    7177            </p><?php
    72 
    73         }
    74 
     78           
     79        }
     80       
    7581        /**
    7682         * Hook to save and save $_POST variables
     83         *
     84         * @param $post_id
     85         * @param $post
     86         *
     87         * @return mixed
    7788         */
    7889        public function save_post_restriction_checkbox( $post_id, $post ) {
    7990
     91            $nonce    = filter_input( INPUT_POST, 'post_restriction_checkbox_nonce' );
     92            $checkbox = isset( $_POST[ 'ss_pp_restrictor_checkbox' ] ) ? filter_input( INPUT_POST, 'ss_pp_restrictor_checkbox', FILTER_SANITIZE_NUMBER_INT ) : 0;
     93
    8094            //verify nonce
    81             if ( ! isset( $_POST['post_restriction_checkbox_nonce'] ) || ! wp_verify_nonce( $_POST['post_restriction_checkbox_nonce'], basename( __FILE__ ) ) ) {
     95            if ( ! isset( $nonce ) || ! wp_verify_nonce( $nonce, basename( __FILE__ ) ) ) {
    8296                //error_log('nonce not valid');
    8397                return $post_id;
    8498            }
    85 
     99           
    86100            //get current post type
    87101            $post_type = get_post_type_object( $post->post_type );
    88 
     102           
    89103            //ensure current user can edit post
    90104            if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) {
    91105                return $post_id;
    92106            }
    93 
     107           
    94108            //new checkbox value
    95             $new_checkbox_value = ( isset( $_POST['ss_pp_restrictor_checkbox'] ) ? filter_var( $_POST['ss_pp_restrictor_checkbox'], FILTER_SANITIZE_NUMBER_INT ) : '' );
    96 
    97             //get old checkbox value
    98             $checkbox_value = get_post_meta( $post_id, 'ss_pp_restrictor_checkbox', true );
    99 
    100             //if new value added and there is no current value
    101             if ( $new_checkbox_value && '' == $checkbox_value ) {
    102 
    103                 add_post_meta( $post_id, 'ss_pp_restrictor_checkbox', $new_checkbox_value, true );
    104 
    105             } else if ( $new_checkbox_value && $new_checkbox_value != $checkbox_value ) { //if new checkbox value submitted and it doesn't match old
    106 
    107                 update_post_meta( $post_id, 'ss_pp_restrictor_checkbox', $new_checkbox_value );
    108 
    109             } else if ( '' == $new_checkbox_value && $checkbox_value ) { //if new checkbox value is empty and old exists, delete new
    110 
    111                 delete_post_meta( $post_id, 'ss_pp_restrictor_checkbox', $checkbox_value );
    112 
    113             }
    114 
    115         }
    116 
     109            $new_checkbox_value = $checkbox === '1' || $checkbox === 0 ? $checkbox : '';
     110
     111            update_post_meta( $post_id, 'ss_pp_restrictor_checkbox', $new_checkbox_value );
     112
     113            return $post_id;
     114           
     115        }
     116       
    117117        /**
    118118         * Add options page
     
    128128            );
    129129        }
    130 
     130       
    131131        /**
    132132         * Options page callback
    133133         */
    134134        public function create_admin_page() {
    135 
     135           
    136136            // Set class property
    137137            $this->options = get_option( 'ss_pp_restrictor_option' );
    138 
     138           
    139139            //var_dump($this->options);
    140 
     140           
    141141            ?>
    142142            <div class="wrap">
     
    150150                </form>
    151151            </div>
    152         <?php
    153         }
    154 
     152            <?php
     153        }
     154       
    155155        /**
    156156         * Register and add settings
     
    162162                array( $this, 'sanitize' ) // Sanitize
    163163            );
    164 
     164           
    165165            add_settings_section(
    166166                'ss_pp_restrictor_settings', // ID
    167                 'Super Simple Post / Page Restrictor Settings', // Title
     167                __( 'Super Simple Post / Page Restrictor Settings', 'ss_pp_restrictor' ), // Title
    168168                array( $this, 'print_section_info' ), // Callback
    169169                'ss_pp_restrictor' // Page
    170170            );
    171 
     171           
    172172            //add setting for ftp server
    173173            add_settings_field(
    174174                'page_unavailable_text', // ID
    175                 'Page unavailable text', // Title
     175                __( 'Page unavailable text', 'ss_pp_restrictor' ), // Title
    176176                array( $this, 'page_unavailable_text_callback' ), // Callback
    177177                'ss_pp_restrictor', // Page
     
    179179            );
    180180
    181 
    182181            add_settings_field(
    183182                'post_type_select', // ID
    184                 'Apply to which post types?', // Title
     183                __( 'Apply to which post types?', 'ss_pp_restrictor' ), // Title
    185184                array( $this, 'post_type_select_callback' ), // Callback
    186185                'ss_pp_restrictor', // Page
    187186                'ss_pp_restrictor_settings' // Section
    188187            );
    189 
     188           
    190189            add_settings_field(
    191190                'user_role_select', // ID
    192                 'Never display restricted content for which user types?', // Title
     191                __( 'Never display restricted content for which user types?', 'ss_pp_restrictor' ), // Title
    193192                array( $this, 'user_role_select_callback' ), // Callback
    194193                'ss_pp_restrictor', // Page
    195194                'ss_pp_restrictor_settings' // Section
    196195            );
    197 
    198         }
    199 
     196           
     197            add_settings_field(
     198                'restrict_by_default', // ID
     199                __( 'Check this box to restrict new posts/pages by default.', 'ss_pp_restrictor' ), // Title
     200                array( $this, 'restrict_by_default_callback' ), // Callback
     201                'ss_pp_restrictor', // Page
     202                'ss_pp_restrictor_settings' // Section
     203            );
     204           
     205        }
     206       
    200207        /**
    201208         * Sanitize each setting field as needed
    202209         *
    203          * @param array $input Contains all settings fields as array keys
     210         * @param $input
     211         *
     212         * @return array
    204213         */
    205214        public function sanitize( $input ) {
    206215            $new_input = array();
    207 
    208             if ( isset( $input['page_unavailable_text'] ) ) {
    209                 $new_input['page_unavailable_text'] = sanitize_text_field( $input['page_unavailable_text'] );
    210             }
    211 
    212             if ( isset( $input['post_type_select'] ) ) {
    213 
    214                 if ( is_array( $input['post_type_select'] ) ) {
    215 
     216           
     217            if ( isset( $input[ 'page_unavailable_text' ] ) ) {
     218                $new_input[ 'page_unavailable_text' ] = sanitize_text_field( $input[ 'page_unavailable_text' ] );
     219            }
     220           
     221            if ( isset( $input[ 'post_type_select' ] ) ) {
     222               
     223                if ( is_array( $input[ 'post_type_select' ] ) ) {
     224                   
    216225                    $all_post_types = get_post_types();
    217 
    218                     foreach ( $input['post_type_select'] as $key => $value ) {
    219 
     226                   
     227                    foreach ( $input[ 'post_type_select' ] as $key => $value ) {
     228                       
    220229                        //sanitize via whitelist - if input does not exist in existing post types, set value to blank string
    221230                        if ( in_array( $value, $all_post_types ) ) {
    222                             $new_input['post_type_select'][ $key ] = $value;
     231                            $new_input[ 'post_type_select' ][ $key ] = $value;
    223232                        } else {
    224                             $new_input['post_type_select'][ $key ] = '';
     233                            $new_input[ 'post_type_select' ][ $key ] = '';
    225234                        }
    226 
     235                       
    227236                    }
    228237                } else {
    229                     $new_input['post_type_select'] = sanitize_text_field( $input['post_type_select'] );
    230                 }
    231             }
    232 
    233             if ( isset( $input['user_role_select'] ) ) {
    234 
     238                    $new_input[ 'post_type_select' ] = sanitize_text_field( $input[ 'post_type_select' ] );
     239                }
     240            }
     241           
     242            if ( isset( $input[ 'user_role_select' ] ) ) {
     243               
    235244                $editable_roles = array_reverse( get_editable_roles() );
    236 
    237                 if ( is_array( $input['user_role_select'] ) ) {
    238                     foreach ( $input['user_role_select'] as $key => $value ) {
    239 
     245               
     246                if ( is_array( $input[ 'user_role_select' ] ) ) {
     247                    foreach ( $input[ 'user_role_select' ] as $key => $value ) {
     248                       
    240249                        //sanitize via whitelist - if input does not exist in editable roles, set value to blank string
    241250                        if ( array_key_exists( $value, $editable_roles ) ) {
    242                             $new_input['user_role_select'][ $key ] = $value;
     251                            $new_input[ 'user_role_select' ][ $key ] = $value;
    243252                        } else {
    244                             $new_input['user_role_select'][ $key ] = '';
     253                            $new_input[ 'user_role_select' ][ $key ] = '';
    245254                        }
    246 
     255                       
    247256                    }
    248257                } else {
    249                     $new_input['user_role_select'] = sanitize_text_field( $input['user_role_select'] );
    250                 }
    251             }
    252 
     258                    $new_input[ 'user_role_select' ] = sanitize_text_field( $input[ 'user_role_select' ] );
     259                }
     260            }
     261
     262            // sanitize restrict by default
     263            if ( isset( $input[ 'restrict_by_default' ] ) ) {
     264                $restrict_by_default = $input[ 'restrict_by_default' ];
     265
     266                if ( $restrict_by_default === '1' || $restrict_by_default === 0 || $restrict_by_default === '' ) {
     267                    $new_input[ 'restrict_by_default' ] = $restrict_by_default;
     268                }
     269            }
     270           
    253271            return $new_input;
    254 
    255         }
    256 
     272           
     273        }
     274       
    257275        /**
    258276         * Print the Section text
     
    261279            // print 'Enter your settings below:';
    262280        }
    263 
     281       
    264282        /**
    265283         * Get the settings option array and print one of its values
     
    269287                '<textarea id="page_unavailable_text" name="ss_pp_restrictor_option[page_unavailable_text]">%s</textarea><br>' .
    270288                '<label class="small-text" for="page_unavailable_text">' . __( 'Enter the text you&apos;d like to display when content is restricted.', 'ss_pp_restrictor' ) . '<br>' . __( 'Defaults to "This content is currently unavailable to you".', 'ss_pp_restrictor' ) . '</label>',
    271                 isset( $this->options['page_unavailable_text'] ) ? esc_attr( $this->options['page_unavailable_text'] ) : '',
     289                isset( $this->options[ 'page_unavailable_text' ] ) ? esc_attr( $this->options[ 'page_unavailable_text' ] ) : '',
    272290                array( 'label_for' => 'page_unavailable_text' )
    273291            );
    274292        }
    275 
     293       
     294        /**
     295         * Callback for post type select
     296         */
    276297        public function post_type_select_callback() {
    277 
     298           
    278299            $all_post_types      = get_post_types();
    279             $selected_post_types = $this->options['post_type_select'];
    280 
     300            $selected_post_types = $this->options[ 'post_type_select' ];
     301           
    281302            if ( is_array( $all_post_types ) ) {
    282303                echo '<select id="post_type_select" data-placeholder="' . __( 'Select some post types', 'ss_pp_restrictor' ) . '" name="ss_pp_restrictor_option[post_type_select][]" multiple>';
     
    286307                        $selected = in_array( $post_type, $selected_post_types ) ? 'selected' : '';
    287308                    }
    288 
     309                   
    289310                    printf( '<option value="%s" %s>%s</option>', $post_type, $selected, $post_type );
    290311                }
    291312                echo '</select>';
    292313            }
    293 
    294         }
    295 
    296 
     314           
     315        }
     316       
     317        /**
     318         * Callback for user role select
     319         */
    297320        public function user_role_select_callback() {
    298 
    299             $selected_user_roles = isset( $this->options['user_role_select'] ) ? $this->options['user_role_select'] : array();
     321           
     322            $selected_user_roles = isset( $this->options[ 'user_role_select' ] ) ? $this->options[ 'user_role_select' ] : array();
    300323            ?>
    301324            <select id="user_role_select"
     
    307330                   for="user_role_select"><?php _e( 'Selected user roles will never be able to see restricted content - even when logged in.', 'ss_pp_restrictor' ); ?></label><?php
    308331        }
    309 
    310 
    311         /*modified wp_dropdown_roles() function - copied from /wp-admin/includes/template.php */
     332       
     333       
     334        /**
     335         * Callback for restrict by default
     336         */
     337        public function restrict_by_default_callback() {
     338
     339            $restrict_by_default = isset( $this->options[ 'restrict_by_default' ] ) ? $this->options[ 'restrict_by_default' ] : false;
     340
     341            ?>
     342            <input name="ss_pp_restrictor_option[restrict_by_default]" type="checkbox" id="restrict_by_default"
     343                   value="1" <?php checked( '1', $restrict_by_default ); ?> />
     344            <label class="small-text"
     345                   for="restrict_by_default"><?php _e( 'Check box to restrict posts/pages by default (checkbox checked and content restricted automatically on new posts).', 'ss_pp_restrictor' ); ?></label>
     346            <?php
     347           
     348        }
     349       
     350        /**
     351         * modified wp_dropdown_roles() function - copied from /wp-admin/includes/template.php
     352         *
     353         * @param bool $selected
     354         */
    312355        private function wp_dropdown_roles( $selected = false ) {
    313 
     356           
    314357            $output = '';
    315 
     358           
    316359            $editable_roles = array_reverse( get_editable_roles() );
    317 
     360           
    318361            if ( ! is_array( $selected ) ) {
    319362                $selected = array( $selected );
    320363            }
    321 
    322 
     364           
    323365            foreach ( $editable_roles as $role => $details ) {
    324                 $name = translate_user_role( $details['name'] );
     366                $name = translate_user_role( $details[ 'name' ] );
    325367                if ( in_array( $role, $selected ) ) {// preselect specified role
    326368                    $output .= "\n\t<option selected='selected' value='" . esc_attr( $role ) . "'>$name</option>";
     
    330372            }
    331373
    332 
    333374            echo $output;
    334 
     375           
    335376        }
    336377    }
    337378}
    338 ?>
  • super-simple-post-page-restricor/trunk/super-simple-post-page-restrictor.php

    r1177974 r1399882  
    44Plugin URI: https://github.com/arippberger/super-simple-post-page-restrictor
    55Description: Adds a super simple post / page restriction option
    6 Version: 1.1
     6Version: 1.2
    77Author: arippberger
    88Author URI: http://alecrippberger.com
     
    2626if ( ! class_exists( 'Super_Simple_Page_Post_Restrictor' ) ) {
    2727
     28    /**
     29     * Class Super_Simple_Page_Post_Restrictor
     30     */
    2831    class Super_Simple_Page_Post_Restrictor {
    2932
     33        /**
     34         * @var mixed|void
     35         */
     36        protected $options;
     37
     38        /**
     39         * @var
     40         */
     41        protected $admin;
     42
     43        /**
     44         * @var
     45         */
     46        protected $current_post_checkbox;
     47
     48        /**
     49         * @var
     50         */
     51        protected $page_unavailable_text;
     52
     53        /**
     54         * Super_Simple_Page_Post_Restrictor constructor.
     55         */
    3056        public function __construct() {
    3157
     
    3763            }
    3864
     65            $this->options = get_option( 'ss_pp_restrictor_option' );
     66
    3967        } // End __construct()
    4068
     69        /**
     70         * Init front end
     71         */
    4172        public function init_frontend() {
    4273
     
    4980        } // End init()
    5081
     82        /**
     83         * Admin includes
     84         */
    5185        public function admin_includes() {
    5286            // loads the admin settings page and adds functionality to the order admin
    5387            require_once( 'super-simple-post-page-restrictor-options.php' );
    54             $this->admin = new Super_simple_post_page_options();
    55         }
    56 
     88            $this->admin = new Super_Simple_Post_Page_Options();
     89        }
     90
     91        /**
     92         * Admin scripts
     93         */
    5794        public function super_simple_post_restrictor_admin_scripts() {
    5895            wp_enqueue_style( 'chosen-styles', plugin_dir_url( __FILE__ ) . '/assets/css/chosen.min.css' );
     
    6097            wp_enqueue_script( 'chosen-init', plugin_dir_url( __FILE__ ) . '/assets/js/chosen-init.js', array(
    6198                'jquery',
    62                 'chosen-script'
     99                'chosen-script',
    63100            ) );
    64101        }
    65102
     103        /**
     104         *
     105         *
     106         * @param $post_object
     107         */
    66108        public function clean_post( $post_object ) {
     109
     110            $restricted_by_default = false;
    67111
    68112            $this->options = get_option( 'ss_pp_restrictor_option' );
     
    71115            $this->current_post_checkbox = get_post_meta( $post_object->ID, 'ss_pp_restrictor_checkbox', true );
    72116
     117            $restrict_by_default_option = isset( $this->options[ 'restrict_by_default' ] ) ? $this->options[ 'restrict_by_default' ] : false;
     118
     119            if ( $this->current_post_checkbox === '' && $restrict_by_default_option ) {
     120                $restricted_by_default = true;
     121            }
     122
    73123            //see if current post type is restricted
    74124            $restricted_post_type = false;
    75             if ( is_array( $this->options['post_type_select'] ) ) {
    76                 if ( in_array( $post_object->post_type, $this->options['post_type_select'] ) ) {
     125            if ( is_array( $this->options[ 'post_type_select' ] ) ) {
     126                if ( in_array( $post_object->post_type, $this->options[ 'post_type_select' ] ) ) {
    77127                    $restricted_post_type = true;
    78128                }
     
    80130
    81131            //get array of roles that may NEVER access content
    82             $restricted_roles = $this->options['user_role_select'];
     132            $restricted_roles = isset( $this->options[ 'user_role_select' ] ) ? $this->options[ 'user_role_select' ] : array();
    83133
    84134            //get array of current user roles
     
    99149
    100150            //if current post is restricted and user is not logged in - OR - check if current post is restricted and user can't access
    101             if ( $this->current_post_checkbox && ! is_user_logged_in() && $restricted_post_type || $restricted_post_type && $this->current_post_checkbox && ! $current_user_can_access ) {
     151            if (
     152                $restricted_by_default && ! is_user_logged_in() && $restricted_post_type ||
     153                $restricted_by_default && $restricted_post_type && ! $current_user_can_access ||
     154                $this->current_post_checkbox && ! is_user_logged_in() && $restricted_post_type ||
     155                $restricted_post_type && $this->current_post_checkbox && ! $current_user_can_access
     156            ) {
    102157                add_filter( 'the_content', array( $this, 'filter_content' ) );
    103158                add_filter( 'the_excerpt', array( $this, 'filter_excerpt' ) );
     
    106161        }
    107162
     163        /**
     164         *
     165         */
    108166        public function restrict_feed() {
    109167            die( 'this is the rss_head' );
    110             add_filter( 'the_content', array( $this, 'filter_feed_content' ) );
    111         }
    112 
     168            //add_filter( 'the_content', array( $this, 'filter_feed_content' ) );
     169        }
     170
     171        /**
     172         * @param $content
     173         *
     174         * @return string
     175         */
    113176        public function filter_feed_content( $content ) {
    114             global $wp_query;
     177
    115178            if ( is_feed() && $this->current_post_checkbox ) {
    116                 $this->page_unavailable_text = $this->options['page_unavailable_text'];
     179                $this->page_unavailable_text = $this->options[ 'page_unavailable_text' ];
    117180                $post_content                = ! empty( $this->page_unavailable_text ) ? $this->page_unavailable_text : 'This content is currently unavailable to you. ';
    118181
     
    124187        }
    125188
     189        /**
     190         * @param $content
     191         *
     192         * @return string
     193         */
    126194        public function filter_content( $content ) {
    127195            if ( $this->current_post_checkbox ) {
    128196
    129                 $this->page_unavailable_text = $this->options['page_unavailable_text'];
     197                $this->page_unavailable_text = $this->options[ 'page_unavailable_text' ];
    130198                $post_content                = ! empty( $this->page_unavailable_text ) ? $this->page_unavailable_text : 'This content is currently unavailable to you. ';
    131199
     
    137205        }
    138206
     207        /**
     208         * @param $excerpt
     209         *
     210         * @return string
     211         */
    139212        public function filter_excerpt( $excerpt ) {
    140213            if ( $this->current_post_checkbox ) {
    141214
    142                 $this->page_unavailable_text = $this->options['page_unavailable_text'];
     215                $this->page_unavailable_text = $this->options[ 'page_unavailable_text' ];
    143216                $post_content                = ! empty( $this->page_unavailable_text ) ? $this->page_unavailable_text : 'This content is currently unavailable to you. ';
    144217
     
    156229         **/
    157230        private function get_current_user_roles() {
    158             global $wp_roles;
     231
    159232            $current_user = wp_get_current_user();
    160233            $roles        = $current_user->roles;
     
    173246global $super_simple_page_post_restrictor;
    174247$super_simple_page_post_restrictor = new Super_Simple_Page_Post_Restrictor();
    175 
    176 ?>
Note: See TracChangeset for help on using the changeset viewer.