Changeset 41634
- Timestamp:
- 09/28/2017 04:28:46 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/embed.php
r41606 r41634 1107 1107 1108 1108 if ( ! $post_id ) { 1109 if ( $switched_blog ) { 1110 restore_current_blog(); 1111 } 1112 1109 1113 return $result; 1110 1114 } -
trunk/tests/phpunit/tests/oembed/wpOembed.php
r41606 r41634 201 201 $this->assertSame( $expected_stack, $actual_stack ); 202 202 } 203 204 /** 205 * @ticket 40673 206 * @group multisite 207 * @group ms-required 208 */ 209 public function test_wp_filter_pre_oembed_result_multisite_restores_state_if_no_post_is_found() { 210 $current_blog_id = get_current_blog_id(); 211 212 $user_id = self::factory()->user->create(); 213 $blog_id = self::factory()->blog->create( array( 214 'user_id' => $user_id, 215 ) ); 216 217 $permalink = get_home_url( $blog_id, '/foo/' ); 218 219 add_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) ); 220 $actual = $this->oembed->get_html( $permalink ); 221 remove_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) ); 222 223 $this->assertNull( $this->pre_oembed_result_filtered ); 224 $this->assertFalse( $actual ); 225 $this->assertSame( $current_blog_id, get_current_blog_id() ); 226 } 203 227 }
Note: See TracChangeset
for help on using the changeset viewer.