Changeset 47808 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r47597 r47808 177 177 } 178 178 179 if ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' == ini_get( 'output_handler' ) ) {179 if ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) ) { 180 180 update_site_option( 'can_compress_scripts', 0 ); 181 181 wp_die( 0 ); … … 210 210 echo $out; 211 211 wp_die(); 212 } elseif ( 'no' == $_GET['test'] ) {212 } elseif ( 'no' === $_GET['test'] ) { 213 213 check_ajax_referer( 'update_can_compress_scripts' ); 214 214 update_site_option( 'can_compress_scripts', 0 ); 215 } elseif ( 'yes' == $_GET['test'] ) {215 } elseif ( 'yes' === $_GET['test'] ) { 216 216 check_ajax_referer( 'update_can_compress_scripts' ); 217 217 update_site_option( 'can_compress_scripts', 1 ); … … 705 705 706 706 if ( isset( $_POST['trash'] ) && 1 == $_POST['trash'] ) { 707 if ( 'trash' == $status ) {707 if ( 'trash' === $status ) { 708 708 wp_die( time() ); 709 709 } … … 711 711 $r = wp_trash_comment( $comment ); 712 712 } elseif ( isset( $_POST['untrash'] ) && 1 == $_POST['untrash'] ) { 713 if ( 'trash' != $status ) {713 if ( 'trash' !== $status ) { 714 714 wp_die( time() ); 715 715 } … … 722 722 } 723 723 } elseif ( isset( $_POST['spam'] ) && 1 == $_POST['spam'] ) { 724 if ( 'spam' == $status ) {724 if ( 'spam' === $status ) { 725 725 wp_die( time() ); 726 726 } … … 728 728 $r = wp_spam_comment( $comment ); 729 729 } elseif ( isset( $_POST['unspam'] ) && 1 == $_POST['unspam'] ) { 730 if ( 'spam' != $status ) {730 if ( 'spam' !== $status ) { 731 731 wp_die( time() ); 732 732 } … … 884 884 } 885 885 886 if ( 'trash-post' == $action ) {886 if ( 'trash-post' === $action ) { 887 887 $done = wp_trash_post( $id ); 888 888 } else { … … 1302 1302 } 1303 1303 1304 if ( '' == $comment_content ) {1304 if ( '' === $comment_content ) { 1305 1305 wp_die( __( 'Error: Please type a comment.' ) ); 1306 1306 } … … 1345 1345 1346 1346 ob_start(); 1347 if ( isset( $_REQUEST['mode'] ) && 'dashboard' == $_REQUEST['mode'] ) {1347 if ( isset( $_REQUEST['mode'] ) && 'dashboard' === $_REQUEST['mode'] ) { 1348 1348 require_once ABSPATH . 'wp-admin/includes/dashboard.php'; 1349 1349 _wp_dashboard_recent_comments_row( $comment ); 1350 1350 } else { 1351 if ( isset( $_REQUEST['mode'] ) && 'single' == $_REQUEST['mode'] ) {1351 if ( isset( $_REQUEST['mode'] ) && 'single' === $_REQUEST['mode'] ) { 1352 1352 $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) ); 1353 1353 } else { … … 1404 1404 } 1405 1405 1406 if ( '' == $_POST['content'] ) {1406 if ( '' === $_POST['content'] ) { 1407 1407 wp_die( __( 'Error: Please type a comment.' ) ); 1408 1408 } … … 1462 1462 if ( 1463 1463 ! empty( $menu_item_data['menu-item-type'] ) && 1464 'custom' != $menu_item_data['menu-item-type'] &&1464 'custom' !== $menu_item_data['menu-item-type'] && 1465 1465 ! empty( $menu_item_data['menu-item-object-id'] ) 1466 1466 ) { … … 1545 1545 } 1546 1546 1547 if ( isset( $_POST['metakeyselect'] ) && '#NONE#' == $_POST['metakeyselect'] && empty( $_POST['metakeyinput'] ) ) {1547 if ( isset( $_POST['metakeyselect'] ) && '#NONE#' === $_POST['metakeyselect'] && empty( $_POST['metakeyinput'] ) ) { 1548 1548 wp_die( 1 ); 1549 1549 } … … 1605 1605 $value = wp_unslash( $_POST['meta'][ $mid ]['value'] ); 1606 1606 1607 if ( '' == trim( $key ) ) {1607 if ( '' === trim( $key ) ) { 1608 1608 wp_die( __( 'Please provide a custom field name.' ) ); 1609 1609 } … … 1796 1796 require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; 1797 1797 1798 if ( isset( $_POST['item-type'] ) && 'post_type' == $_POST['item-type'] ) {1798 if ( isset( $_POST['item-type'] ) && 'post_type' === $_POST['item-type'] ) { 1799 1799 $type = 'posttype'; 1800 1800 $callback = 'wp_nav_menu_item_post_type_meta_box'; 1801 1801 $items = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); 1802 } elseif ( isset( $_POST['item-type'] ) && 'taxonomy' == $_POST['item-type'] ) {1802 } elseif ( isset( $_POST['item-type'] ) && 'taxonomy' === $_POST['item-type'] ) { 1803 1803 $type = 'taxonomy'; 1804 1804 $callback = 'wp_nav_menu_item_taxonomy_meta_box'; … … 1986 1986 $post_ID = (int) $_POST['post_ID']; 1987 1987 1988 if ( 'page' == $_POST['post_type'] ) {1988 if ( 'page' === $_POST['post_type'] ) { 1989 1989 if ( ! current_user_can( 'edit_page', $post_ID ) ) { 1990 1990 wp_die( __( 'Sorry, you are not allowed to edit this page.' ) ); … … 2031 2031 2032 2032 // Status. 2033 if ( isset( $data['keep_private'] ) && 'private' == $data['keep_private'] ) {2033 if ( isset( $data['keep_private'] ) && 'private' === $data['keep_private'] ) { 2034 2034 $data['visibility'] = 'private'; 2035 2035 $data['post_status'] = 'private'; … … 2181 2181 foreach ( $posts as $post ) { 2182 2182 $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' ); 2183 $alt = ( 'alternate' == $alt ) ? '' : 'alternate';2183 $alt = ( 'alternate' === $alt ) ? '' : 'alternate'; 2184 2184 2185 2185 switch ( $post->post_status ) { … … 2199 2199 } 2200 2200 2201 if ( '0000-00-00 00:00:00' == $post->post_date ) {2201 if ( '0000-00-00 00:00:00' === $post->post_date ) { 2202 2202 $time = ''; 2203 2203 } else { … … 2884 2884 } 2885 2885 2886 if ( 'attachment' != $post->post_type ) {2886 if ( 'attachment' !== $post->post_type ) { 2887 2887 wp_send_json_error(); 2888 2888 } … … 2997 2997 $post = get_post( $id, ARRAY_A ); 2998 2998 2999 if ( 'attachment' != $post['post_type'] ) {2999 if ( 'attachment' !== $post['post_type'] ) { 3000 3000 wp_send_json_error(); 3001 3001 } … … 3088 3088 $post = get_post( $id, ARRAY_A ); 3089 3089 3090 if ( 'attachment' != $post['post_type'] ) {3090 if ( 'attachment' !== $post['post_type'] ) { 3091 3091 wp_send_json_error(); 3092 3092 } … … 3155 3155 } 3156 3156 3157 if ( 'attachment' != $attachment->post_type ) {3157 if ( 'attachment' !== $attachment->post_type ) { 3158 3158 continue; 3159 3159 } … … 3191 3191 } 3192 3192 3193 if ( 'attachment' != $post->post_type ) {3193 if ( 'attachment' !== $post->post_type ) { 3194 3194 wp_send_json_error(); 3195 3195 } … … 3305 3305 if ( $ext ) { 3306 3306 $ext_type = wp_ext2type( $ext ); 3307 if ( 'audio' == $ext_type || 'video'== $ext_type ) {3307 if ( 'audio' === $ext_type || 'video' === $ext_type ) { 3308 3308 $type = $ext_type; 3309 3309 }
Note: See TracChangeset
for help on using the changeset viewer.