WP_Site_Icon::get_post_metadata() – Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon.

You appear to be a bot. Output may be restricted

Description

Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon.

Usage

$array|null|string = WP_Site_Icon::get_post_metadata( $value, $post_id, $meta_key, $single );

Parameters

$value
( null|array|string ) required – The value get_metadata() should return a single metadata value, or an array of values.
$post_id
( int ) required – Post ID.
$meta_key
( string ) required – Meta key.
$single
( bool ) required – Whether to return only the first value of the specified `$meta_key`.

Returns

array|null|string The attachment metadata value, array of values, or null.

Source

File name: wordpress/wp-admin/includes/class-wp-site-icon.php
Lines:

1 to 11 of 11
  public function get_post_metadata( $value, $post_id, $meta_key, $single ) {
    if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {
      $site_icon_id = get_option( 'site_icon' );

      if ( $post_id == $site_icon_id ) {
        add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' )  < );
      }
    }

    return $value;
  }
 

 View on GitHub View on Trac