| @@ -166,22 +166,23 @@ | ||
| 166 | 166 | 'not_found' => __( 'No Protected Areas found.', 'content-protector' ), |
| 167 | 167 | 'not_found_in_trash' => __( 'No Protected Areas found in Trash.', 'content-protector' ), |
| 168 | 168 | ); |
| 169 | 169 | $args = array( |
| 170 | - 'labels' => $labels, | |
| 171 | - 'description' => __( 'Manageable protected areas', 'content-protector' ), | |
| 172 | - 'public' => false, | |
| 173 | - 'publicly_queryable' => false, | |
| 174 | - 'show_ui' => true, | |
| 175 | - 'show_in_menu' => 'passster', | |
| 176 | - 'query_var' => true, | |
| 177 | - 'rewrite' => false, | |
| 178 | - 'capability_type' => 'post', | |
| 179 | - 'has_archive' => false, | |
| 180 | - 'hierarchical' => false, | |
| 181 | - 'menu_position' => null, | |
| 182 | - 'supports' => array('title', 'editor'), | |
| 183 | - 'show_in_rest' => true, | |
| 170 | + 'labels' => $labels, | |
| 171 | + 'description' => __( 'Manageable protected areas', 'content-protector' ), | |
| 172 | + 'public' => false, | |
| 173 | + 'publicly_queryable' => false, | |
| 174 | + 'show_ui' => true, | |
| 175 | + 'show_in_menu' => 'passster', | |
| 176 | + 'query_var' => true, | |
| 177 | + 'rewrite' => false, | |
| 178 | + 'capability_type' => 'post', | |
| 179 | + 'has_archive' => false, | |
| 180 | + 'hierarchical' => false, | |
| 181 | + 'menu_position' => null, | |
| 182 | + 'supports' => array('title', 'editor'), | |
| 183 | + 'show_in_rest' => true, | |
| 184 | + 'rest_controller_class' => PS_Protected_Areas_Rest_Controller::class, | |
| 184 | 185 | ); |
| 185 | 186 | if ( current_user_can( 'administrator' ) && (is_plugin_active( 'elementor/elementor.php' ) || is_plugin_active( 'fusion-builder/fusion-builder.php' ) || is_plugin_active( 'livecanvas/livecanvas-plugin-index.php' ) || is_plugin_active( 'divi-builder/divi-builder.php' ) || is_plugin_active( 'oxygen/functions.php' )) ) { |
| 186 | 187 | $args['public'] = true; |
| 187 | 188 | $args['publicly_queryable'] = true; |
| @@ -186,9 +187,9 @@ | ||
| 186 | 187 | $args['public'] = true; |
| 187 | 188 | $args['publicly_queryable'] = true; |
| 188 | 189 | } |
| 189 | 190 | $theme = wp_get_theme(); |
| 190 | - if ( current_user_can( 'administrator' ) && 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ) { | |
| 191 | + if ( current_user_can( 'administrator' ) && ('Divi' == $theme->name || 'Divi' == $theme->parent_theme) ) { | |
| 191 | 192 | $args['public'] = true; |
| 192 | 193 | $args['publicly_queryable'] = true; |
| 193 | 194 | } |
| 194 | 195 | register_post_type( 'protected_areas', $args ); |