Changeset 47802
- Timestamp:
- 05/15/2020 06:11:40 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-screen.php
r47550 r47802 229 229 $id = 'post'; // Changes later. Ends up being $base. 230 230 } else { 231 if ( '.php' == substr( $id, -4 ) ) {231 if ( '.php' === substr( $id, -4 ) ) { 232 232 $id = substr( $id, 0, -4 ); 233 233 } 234 234 235 if ( 'post-new' == $id || 'link-add' == $id || 'media-new' == $id || 'user-new' == $id) {235 if ( in_array( $id, array( 'post-new', 'link-add', 'media-new', 'user-new' ), true ) ) { 236 236 $id = substr( $id, 0, -4 ); 237 237 $action = 'add'; … … 240 240 241 241 if ( ! $post_type && $hook_name ) { 242 if ( '-network' == substr( $id, -8 ) ) {242 if ( '-network' === substr( $id, -8 ) ) { 243 243 $id = substr( $id, 0, -8 ); 244 244 $in_admin = 'network'; 245 } elseif ( '-user' == substr( $id, -5 ) ) {245 } elseif ( '-user' === substr( $id, -5 ) ) { 246 246 $id = substr( $id, 0, -5 ); 247 247 $in_admin = 'user'; … … 249 249 250 250 $id = sanitize_key( $id ); 251 if ( 'edit-comments' != $id && 'edit-tags' != $id && 'edit-'== substr( $id, 0, 5 ) ) {251 if ( 'edit-comments' !== $id && 'edit-tags' !== $id && 'edit-' === substr( $id, 0, 5 ) ) { 252 252 $maybe = substr( $id, 5 ); 253 253 if ( taxonomy_exists( $maybe ) ) { … … 273 273 } 274 274 275 if ( 'index' == $id ) {275 if ( 'index' === $id ) { 276 276 $id = 'dashboard'; 277 } elseif ( 'front' == $id ) {277 } elseif ( 'front' === $id ) { 278 278 $in_admin = false; 279 279 } … … 364 364 } 365 365 366 if ( 'network' == $in_admin ) {366 if ( 'network' === $in_admin ) { 367 367 $id .= '-network'; 368 368 $base .= '-network'; 369 } elseif ( 'user' == $in_admin ) {369 } elseif ( 'user' === $in_admin ) { 370 370 $id .= '-user'; 371 371 $base .= '-user'; … … 386 386 $screen->post_type = (string) $post_type; 387 387 $screen->taxonomy = (string) $taxonomy; 388 $screen->is_user = ( 'user' == $in_admin );389 $screen->is_network = ( 'network' == $in_admin );388 $screen->is_user = ( 'user' === $in_admin ); 389 $screen->is_network = ( 'network' === $in_admin ); 390 390 $screen->in_admin = $in_admin; 391 391 $screen->is_block_editor = $is_block_editor; … … 443 443 } 444 444 445 return ( $admin == $this->in_admin );445 return ( $admin === $this->in_admin ); 446 446 } 447 447 … … 1121 1121 update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked ); 1122 1122 } else { 1123 $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );1124 if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {1123 $welcome_checked = (int) get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); 1124 if ( 2 === $welcome_checked && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) { 1125 1125 $welcome_checked = false; 1126 1126 } … … 1243 1243 } 1244 1244 1245 if ( 'edit_comments_per_page' == $option ) {1245 if ( 'edit_comments_per_page' === $option ) { 1246 1246 $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; 1247 1247 1248 1248 /** This filter is documented in wp-admin/includes/class-wp-comments-list-table.php */ 1249 1249 $per_page = apply_filters( 'comments_per_page', $per_page, $comment_status ); 1250 } elseif ( 'categories_per_page' == $option ) {1250 } elseif ( 'categories_per_page' === $option ) { 1251 1251 /** This filter is documented in wp-admin/includes/class-wp-terms-list-table.php */ 1252 1252 $per_page = apply_filters( 'edit_categories_per_page', $per_page );
Note: See TracChangeset
for help on using the changeset viewer.