Changeset 35572
- Timestamp:
- 11/08/2015 02:03:34 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/general-template.php (modified) (2 diffs)
-
tests/phpunit/tests/general/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r35571 r35572 759 759 */ 760 760 function get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) { 761 if ( $blog_id && is_multisite() ) {762 $site_icon_id = get_blog_option( $blog_id, 'site_icon');763 } else {764 $site_icon_id = get_option( 'site_icon' ); 765 }761 if ( is_multisite() && (int) $blog_id !== get_current_blog_id() ) { 762 switch_to_blog( $blog_id ); 763 } 764 765 $site_icon_id = get_option( 'site_icon' ); 766 766 767 767 if ( $site_icon_id ) { … … 772 772 } 773 773 $url = wp_get_attachment_image_url( $site_icon_id, $size_data ); 774 } 775 776 if ( is_multisite() && ms_is_switched() ) { 777 restore_current_blog(); 774 778 } 775 779 -
trunk/tests/phpunit/tests/general/template.php
r35309 r35572 56 56 $this->_remove_site_icon(); 57 57 $this->assertFalse( has_site_icon() ); 58 } 59 60 /** 61 * @group site_icon 62 * @group multisite 63 */ 64 function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() { 65 if ( ! is_multisite() ) { 66 $this->markTestSkipped( 'This test requires multisite.' ); 67 } 68 69 $blog_id = $this->factory->blog->create(); 70 switch_to_blog( $blog_id ); 71 $this->_set_site_icon(); 72 restore_current_blog(); 73 74 $this->assertTrue( has_site_icon( $blog_id ) ); 75 } 76 77 /** 78 * @group site_icon 79 * @group multisite 80 */ 81 function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() { 82 if ( ! is_multisite() ) { 83 $this->markTestSkipped( 'This test requires multisite.' ); 84 } 85 86 $blog_id = $this->factory->blog->create(); 87 88 $this->assertFalse( has_site_icon( $blog_id ) ); 58 89 } 59 90
Note: See TracChangeset
for help on using the changeset viewer.