Skip to content

Commit

Permalink
Improve theme.php to use _deprecated_argument() (ClassicPress#1419)
Browse files Browse the repository at this point in the history
* Update theme.php to use correct deprecation function

* Update theme.php to replace trailing space with full stop

* Fix failing unit tests

---------

Co-authored-by: mattyrob <[email protected]>
  • Loading branch information
KTS915 and mattyrob authored Apr 29, 2024
1 parent 7fc3bc0 commit 6d0ca5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/wp-includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -2607,10 +2607,10 @@ function add_theme_support( $feature, ...$args ) {

case 'html5':
// Since CP-2.0.0 HTLM5 has been expected as theme default
_doing_it_wrong(
_deprecated_argument(
"add_theme_support( 'html5' )",
__( 'HTML5 is the default ' ),
'CP-2.0.0'
'CP-2.0.0',
__( 'HTML5 is the default.' )
);

return true;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/theme/support.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function test_post_thumbnails_mixed_args() {
/**
* @PR 200
*
* @expectedIncorrectUsage add_theme_support( 'html5' )
* @expectedDeprecated add_theme_support( 'html5' )
*/
public function test_supports_html5() {
$this->assertTrue( current_theme_supports( 'html5' ) );
Expand Down

0 comments on commit 6d0ca5f

Please sign in to comment.