Changeset 58360 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 06/07/2024 12:27:59 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r58212 r58360 73 73 } 74 74 75 if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )75 if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] !== $post_data['user_ID'] ) 76 76 && ! current_user_can( $ptype->cap->edit_others_posts ) ) { 77 77 … … 166 166 167 167 foreach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) { 168 if ( ! empty( $post_data[ 'hidden_' . $timeunit ] ) && $post_data[ 'hidden_' . $timeunit ] != $post_data[ $timeunit ] ) {168 if ( ! empty( $post_data[ 'hidden_' . $timeunit ] ) && $post_data[ 'hidden_' . $timeunit ] !== $post_data[ $timeunit ] ) { 169 169 $post_data['edit_date'] = '1'; 170 170 break; … … 376 376 } 377 377 378 if ( $meta->post_id != $post_id ) {378 if ( (int) $meta->post_id !== $post_id ) { 379 379 continue; 380 380 } … … 403 403 } 404 404 405 if ( $meta->post_id != $post_id ) {405 if ( (int) $meta->post_id !== $post_id ) { 406 406 continue; 407 407 } … … 517 517 } 518 518 519 if ( -1== $post_data['_status'] ) {519 if ( '-1' === $post_data['_status'] ) { 520 520 $post_data['post_status'] = null; 521 521 unset( $post_data['post_status'] ); … … 551 551 552 552 foreach ( $reset as $field ) { 553 if ( isset( $post_data[ $field ] ) && ( '' === $post_data[ $field ] || -1== $post_data[ $field ] ) ) {553 if ( isset( $post_data[ $field ] ) && ( '' === $post_data[ $field ] || '-1' === $post_data[ $field ] ) ) { 554 554 unset( $post_data[ $field ] ); 555 555 } … … 1405 1405 */ 1406 1406 function postbox_classes( $box_id, $screen_id ) { 1407 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {1407 if ( isset( $_GET['edit'] ) && $_GET['edit'] === $box_id ) { 1408 1408 $classes = array( '' ); 1409 1409 } elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) { … … 1578 1578 // Encourage a pretty permalink setting. 1579 1579 if ( ! get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) 1580 && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' )== $post->ID )1580 && ! ( 'page' === get_option( 'show_on_front' ) && (int) get_option( 'page_on_front' ) === $post->ID ) 1581 1581 ) { 1582 1582 $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small">' . __( 'Change Permalink Structure' ) . "</a></span>\n"; … … 1714 1714 $lock = explode( ':', $lock ); 1715 1715 $time = $lock[0]; 1716 $user = isset( $lock[1] ) ? $lock[1] :get_post_meta( $post->ID, '_edit_last', true );1716 $user = isset( $lock[1] ) ? (int) $lock[1] : (int) get_post_meta( $post->ID, '_edit_last', true ); 1717 1717 1718 1718 if ( ! get_userdata( $user ) ) { … … 1723 1723 $time_window = apply_filters( 'wp_check_post_lock_window', 150 ); 1724 1724 1725 if ( $time && $time > time() - $time_window && get_current_user_id() != $user ) {1725 if ( $time && $time > time() - $time_window && get_current_user_id() !== $user ) { 1726 1726 return $user; 1727 1727 } … … 1753 1753 $user_id = get_current_user_id(); 1754 1754 1755 if ( 0 == $user_id ) {1755 if ( 0 === $user_id ) { 1756 1756 return false; 1757 1757 } … … 1830 1830 $query_args = array(); 1831 1831 if ( get_post_type_object( $post->post_type )->public ) { 1832 if ( 'publish' === $post->post_status || $user->ID != $post->post_author ) {1832 if ( 'publish' === $post->post_status || $user->ID !== (int) $post->post_author ) { 1833 1833 // Latest content is in autosave. 1834 1834 $nonce = wp_create_nonce( 'post_preview_' . $post->ID ); … … 2082 2082 $is_autosave = false; 2083 2083 2084 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author2084 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() === (int) $post->post_author 2085 2085 && ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) 2086 2086 ) { … … 2157 2157 } 2158 2158 2159 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author2159 if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() === (int) $post->post_author 2160 2160 && ( 'auto-draft' === $post->post_status || 'draft' === $post->post_status ) 2161 2161 ) { … … 2409 2409 $meta_boxes = (array) $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ]; 2410 2410 foreach ( $meta_boxes as $meta_box ) { 2411 if ( false == $meta_box || ! $meta_box['title'] ) {2411 if ( false === $meta_box || ! $meta_box['title'] ) { 2412 2412 continue; 2413 2413 }
Note: See TracChangeset
for help on using the changeset viewer.