Site Icon: Get site icon ID only when needed.
Cuts down on unnecessary queries, especially in environments that rely on post meta a lot. Reverts [32997]. Props ap.koponen, swissspidy. Fixes #34368. Built from https://develop.svn.wordpress.org/trunk@35299 git-svn-id: http://core.svn.wordpress.org/trunk@35265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0ea90a9174
commit
f6941fddf4
|
@ -229,10 +229,12 @@ class WP_Site_Icon {
|
|||
* @return array|null|string The attachment metadata value, array of values, or null.
|
||||
*/
|
||||
public function get_post_metadata( $value, $post_id, $meta_key, $single ) {
|
||||
$site_icon_id = get_option( 'site_icon' );
|
||||
if ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {
|
||||
$site_icon_id = get_option( 'site_icon' );
|
||||
|
||||
if ( $post_id == $site_icon_id && '_wp_attachment_backup_sizes' == $meta_key && $single ) {
|
||||
add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );
|
||||
if ( $post_id == $site_icon_id ) {
|
||||
add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-35298';
|
||||
$wp_version = '4.4-alpha-35299';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue