Make WordPress Core

Changeset 45422


Ignore:
Timestamp:
05/25/2019 11:40:06 PM (6 years ago)
Author:
johnbillion
Message:

Docs: Improve documentation for variadic functions relating to post type support and theme support.

See #37402

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r45219 r45422  
    17431743
    17441744/**
    1745  * Register support of certain features for a post type.
     1745 * Registers support of certain features for a post type.
    17461746 *
    17471747 * All core features are directly associated with a functional area of the edit
     
    17541754 * count will show on the edit screen.
    17551755 *
     1756 * Example usage:
     1757 *
     1758 *     add_post_type_support( 'my_post_type', 'comments' );
     1759 *     add_post_type_support( 'my_post_type', array(
     1760 *         'author', 'excerpt',
     1761 *     ) );
     1762 *     add_post_type_support( 'my_post_type', 'my_feature', array(
     1763 *         'field' => 'value',
     1764 *     ) );
     1765 *
    17561766 * @since 3.0.0
    17571767 *
     
    17611771 * @param string|array $feature   The feature being added, accepts an array of
    17621772 *                                feature strings or a single string.
     1773 * @param mixed        ...$args   Optional extra arguments to pass along with certain features.
    17631774 */
    17641775function add_post_type_support( $post_type, $feature ) {
  • trunk/src/wp-includes/theme.php

    r45418 r45422  
    23192319 * The {@see 'init'} hook may be too late for some features.
    23202320 *
     2321 * Example usage:
     2322 *
     2323 *     add_theme_support( 'title-tag' );
     2324 *     add_theme_support( 'custom-logo', array(
     2325 *         'height' => 480,
     2326 *         'width'  => 720,
     2327 *     ) );
     2328 *
    23212329 * @since 2.9.0
    23222330 * @since 3.6.0 The `html5` feature was added
     
    26372645 * Gets the theme support arguments passed when registering that support
    26382646 *
     2647 * Example usage:
     2648 *
     2649 *     get_theme_support( 'custom-logo' );
     2650 *     get_theme_support( 'custom-header', 'width' );
     2651 *
    26392652 * @since 3.1.0
    26402653 *
     
    26422655 *
    26432656 * @param string $feature The feature to check.
     2657 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
    26442658 * @return mixed The array of extra arguments or the value for the registered feature.
    26452659 */
     
    27522766 * Checks a theme's support for a given feature.
    27532767 *
     2768 * Example usage:
     2769 *
     2770 *     current_theme_supports( 'custom-logo' );
     2771 *     current_theme_supports( 'html5', 'comment-form' );
     2772 *
    27542773 * @since 2.9.0
    27552774 *
     
    27572776 *
    27582777 * @param string $feature The feature being checked.
     2778 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
    27592779 * @return bool True if the current theme supports the feature, false otherwise.
    27602780 */
Note: See TracChangeset for help on using the changeset viewer.