Ticket #39754: 39754.diff
File 39754.diff, 1.5 KB (added by , 8 years ago) |
---|
-
src/wp-includes/post-formats.php
222 222 if ( in_array( 'post_format', (array) $taxonomies ) ) { 223 223 if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) { 224 224 foreach ( $terms as $order => $name ) { 225 $terms[$order] = get_post_format_string( str_replace( 'post-format-', '', $name ) ); 225 if ( 0 === strpos( $name, 'post-format-' ) ) { 226 $string = get_post_format_string( str_replace( 'post-format-', '', $name ) ); 227 228 if ( $string ) { 229 $terms[ $order ] = $string; 230 } 231 } 226 232 } 227 233 } else { 228 234 foreach ( (array) $terms as $order => $term ) { -
tests/phpunit/tests/post/formats.php
156 156 $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) ); 157 157 $this->assertEquals( false, $content_link ); 158 158 } 159 160 function test_post_format_get_terms_skips_non_format_names() { 161 $this->assertSame( 162 array( 'Foo', 'post-format-foo', 'aside', 'Aside' ), 163 _post_format_get_terms( 164 array( 'Foo', 'post-format-foo', 'aside', 'post-format-aside' ), 165 array( 'post_format', 'category' ), 166 array( 'fields' => 'names' ) 167 ) 168 ); 169 } 159 170 }