Make WordPress Core


Ignore:
Timestamp:
10/27/2020 07:58:10 PM (4 years ago)
Author:
helen
Message:

Post Formats: You have to pass an array of supported post formats.

This shows a _doing_it_wrong() message and also returns false instead of true if no array of formats is passed in add_theme_support(), avoiding a PHP error.

Post formats maintainership comes full circle. 🙃

Props Mista-Flo, sproutchris, garrett-eclipse.
Fixes #51390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/formats.php

    r48937 r49344  
    77    function setUp() {
    88        parent::setUp();
     9    }
     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' ) );
    919    }
    1020
Note: See TracChangeset for help on using the changeset viewer.