Coding Standards: Use strict comparison in wp-admin/includes/class-wp-site-icon.php.

Follow-up to [32994], [35299].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55678


git-svn-id: http://core.svn.wordpress.org/trunk@55190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-04-23 04:02:18 +00:00
parent 0c5a04d541
commit 6f745b9fca
3 changed files with 6 additions and 6 deletions

View File

@ -201,9 +201,9 @@ class WP_Site_Icon {
* @param int $post_id Attachment ID. * @param int $post_id Attachment ID.
*/ */
public function delete_attachment_data( $post_id ) { public function delete_attachment_data( $post_id ) {
$site_icon_id = get_option( 'site_icon' ); $site_icon_id = (int) get_option( 'site_icon' );
if ( $site_icon_id && $post_id == $site_icon_id ) { if ( $site_icon_id && $post_id === $site_icon_id ) {
delete_option( 'site_icon' ); delete_option( 'site_icon' );
} }
} }
@ -222,9 +222,9 @@ class WP_Site_Icon {
*/ */
public function get_post_metadata( $value, $post_id, $meta_key, $single ) { public function get_post_metadata( $value, $post_id, $meta_key, $single ) {
if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) { if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {
$site_icon_id = get_option( 'site_icon' ); $site_icon_id = (int) get_option( 'site_icon' );
if ( $post_id == $site_icon_id ) { if ( $post_id === $site_icon_id ) {
add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) ); add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );
} }
} }

View File

@ -956,7 +956,7 @@ function get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {
$switched_blog = true; $switched_blog = true;
} }
$site_icon_id = get_option( 'site_icon' ); $site_icon_id = (int) get_option( 'site_icon' );
if ( $site_icon_id ) { if ( $site_icon_id ) {
if ( $size >= 512 ) { if ( $size >= 512 ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-alpha-55677'; $wp_version = '6.3-alpha-55678';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.