Ticket #51390: 51390.4.diff
File 51390.4.diff, 1.5 KB (added by , 5 years ago) |
---|
-
src/wp-includes/theme.php
2475 2475 * by adding it to the function signature. 2476 2476 * @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default. 2477 2477 * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'. 2478 * @since 5.6.0 The `post-formats` feature now returns doing it wrong if no array is passed 2478 2479 * 2479 2480 * @global array $_wp_theme_features 2480 2481 * … … 2517 2518 unset( $post_formats['standard'] ); 2518 2519 2519 2520 $args[0] = array_intersect( $args[0], array_keys( $post_formats ) ); 2521 } else { 2522 _doing_it_wrong( "add_theme_support( 'post-formats' )", __( 'You need to pass an array of types.' ), '5.6.0' ); 2523 return false; 2520 2524 } 2521 2525 break; 2522 2526 -
tests/phpunit/tests/post/formats.php
8 8 parent::setUp(); 9 9 } 10 10 11 /** 12 * @ticket 51390 13 */ 14 function test_post_format_doing_it_wrong() { 15 $this->setExpectedIncorrectUsage( "add_theme_support( 'post-formats' )" ); 16 17 // The second parameter should be an array. 18 $this->assertFalse( add_theme_support( 'post-formats' ) ); 19 } 20 11 21 function test_set_get_post_format_for_post() { 12 22 $post_id = self::factory()->post->create(); 13 23