Make WordPress Core


Ignore:
Timestamp:
04/23/2023 04:00:26 AM (22 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-icon.php

    r54133 r55678  
    202202     */
    203203    public function delete_attachment_data( $post_id ) {
    204         $site_icon_id = get_option( 'site_icon' );
    205 
    206         if ( $site_icon_id && $post_id == $site_icon_id ) {
     204        $site_icon_id = (int) get_option( 'site_icon' );
     205
     206        if ( $site_icon_id && $post_id === $site_icon_id ) {
    207207            delete_option( 'site_icon' );
    208208        }
     
    223223    public function get_post_metadata( $value, $post_id, $meta_key, $single ) {
    224224        if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {
    225             $site_icon_id = get_option( 'site_icon' );
    226 
    227             if ( $post_id == $site_icon_id ) {
     225            $site_icon_id = (int) get_option( 'site_icon' );
     226
     227            if ( $post_id === $site_icon_id ) {
    228228                add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );
    229229            }
Note: See TracChangeset for help on using the changeset viewer.