WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#37067 closed defect (bug) (fixed)

add_theme_support() docs do not mention second parameter $arguments

Reported by: kevinwhoffman Owned by: DrewAPicture
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: General Keywords: good-first-bug has-patch
Focuses: docs Cc:
PR Number:

Description

add_theme_support() has two parameters, $feature and $arguments as documented in the Codex:

https://codex.wordpress.org/Function_Reference/add_theme_support

<?php add_theme_support( $feature, $arguments ); ?>

The Code Reference only lists one parameter, $feature:

https://developer.wordpress.org/reference/functions/add_theme_support/

The Code Reference should be updated to document the $arguments parameter for use cases like the following:

<?php add_theme_support( 'post-thumbnails', array( 'post_type' ) ); ?>

Moved from #meta1764

Attachments (1)

37067.diff (1.1 KB) - added by DrewAPicture 3 years ago.

Download all attachments as: .zip

Change History (11)

This ticket was mentioned in Slack in #meta-devhub by drew. View the logs.


3 years ago

#2 @DrewAPicture
3 years ago

In 37671:

Docs: Improve documentation for the $feature parameter in the DocBlock for add_theme_support().

See #32246. See #37067.

@DrewAPicture
3 years ago

#3 @DrewAPicture
3 years ago

  • Owner set to DrewAPicture
  • Resolution set to fixed
  • Status changed from new to closed

In 37672:

Docs: Add documentation for the variadic second parameter, $args, accepted by add_theme_support().

h/t kevinwhoffman
Fixes #37067.

#4 @DrewAPicture
3 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.6

Due to the extensive context of the second parameter, $args, let's handle migrating that content from the Codex into the "More Information" section instead of trying to squeeze it into the DocBlock.

#5 follow-up: @DrewAPicture
3 years ago

@kevinwhoffman I've migrated the Codex information to the Code Reference page. The new argument docs will come over when we reparse following the 4.6 release.

https://developer.wordpress.org/reference/functions/add_theme_support/

#6 in reply to: ↑ 5 ; follow-up: @kevinwhoffman
3 years ago

Replying to DrewAPicture:

@kevinwhoffman I've migrated the Codex information to the Code Reference page. The new argument docs will come over when we reparse following the 4.6 release.

Note that => in all of the array examples is showing as =&gt;

Other than that, the page is so much more helpful now. Thanks.

#7 in reply to: ↑ 6 @DrewAPicture
3 years ago

Replying to kevinwhoffman:

Replying to DrewAPicture:

@kevinwhoffman I've migrated the Codex information to the Code Reference page. The new argument docs will come over when we reparse following the 4.6 release.

Note that => in all of the array examples is showing as =&gt;

Yeah, that's an encoding problem we need to fix on DevHub. /cc @coffee2code

#8 follow-up: @coffee2code
3 years ago

@DrewAPicture: For the 'more info' for this post, the multiple &gt; were there in the raw content. I simply edited the post to change &gt; to > and all appears well.

#9 in reply to: ↑ 8 @kevinwhoffman
3 years ago

Replying to coffee2code:

@DrewAPicture: For the 'more info' for this post, the multiple &gt; were there in the raw content. I simply edited the post to change &gt; to > and all appears well.

There's an extra ; on line 8 of the custom-header example.

#10 @coffee2code
3 years ago

@kevinwhoffman: Thanks! Fixed.

Note: See TracTickets for help on using tickets.