Uses
Uses | Description |
---|---|
wp-includes/plugin.php: add_filter() | Hook a function or method to a specific filter action. |
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon.
(null|array|string) (Required) The value get_metadata() should return a single metadata value, or an array of values.
(int) (Required) Post ID.
(string) (Required) Meta key.
(string|array) (Required) Meta value, or an array of values.
(array|null|string) The attachment metadata value, array of values, or null.
File: wp-admin/includes/class-wp-site-icon.php
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; }
Version | Description |
---|---|
4.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_site_icon/get_post_metadata