Clarify inline documentation for the 'html5' case and PHPDoc return in add_theme_support().

Props jond3r.
Fixes #27278.

Built from https://develop.svn.wordpress.org/trunk@27879


git-svn-id: http://core.svn.wordpress.org/trunk@27710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-03-31 22:20:16 +00:00
parent d8622b39d6
commit f13d04e5cf

View File

@ -1384,7 +1384,9 @@ function remove_editor_styles() {
* The init hook may be too late for some features. * The init hook may be too late for some features.
* *
* @since 2.9.0 * @since 2.9.0
* @param string $feature the feature being added *
* @param string $feature The feature being added.
* @return void|bool False on failure, void otherwise.
*/ */
function add_theme_support( $feature ) { function add_theme_support( $feature ) {
global $_wp_theme_features; global $_wp_theme_features;
@ -1403,6 +1405,7 @@ function add_theme_support( $feature ) {
case 'html5' : case 'html5' :
// You can't just pass 'html5', you need to pass an array of types. // You can't just pass 'html5', you need to pass an array of types.
if ( empty( $args[0] ) ) { if ( empty( $args[0] ) ) {
// Build an array of types for back-compat.
$args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) ); $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) );
} elseif ( ! is_array( $args[0] ) ) { } elseif ( ! is_array( $args[0] ) ) {
_doing_it_wrong( "add_theme_support( 'html5' )", 'You need to pass an array of types.', '3.6.1' ); _doing_it_wrong( "add_theme_support( 'html5' )", 'You need to pass an array of types.', '3.6.1' );