Make WordPress Core

Changeset 25429


Ignore:
Timestamp:
09/13/2013 07:24:26 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Inline documentation for hooks in wp-includes/author-template.php.

props Frank Klein.
see #25229.

File:
1 edited

Legend:

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

    r24628 r25429  
    2727        _deprecated_argument( __FUNCTION__, '2.1' );
    2828
     29    /**
     30     * Filter the display name of the current post's author.
     31     *
     32     * @since 2.9.0
     33     *
     34     * @param string $authordata->display_name The author's display name.
     35     */
    2936    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
    3037}
     
    7279    if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {
    7380        $last_user = get_userdata($last_id);
     81
     82        /**
     83         * Filter the display name of the author who last edited the current post.
     84         *
     85         * @since 2.8.0
     86         *
     87         * @param string $last_user->display_name The author's display name.
     88         */
    7489        return apply_filters('the_modified_author', $last_user->display_name);
    7590    }
     
    109124    $value = isset( $authordata->$field ) ? $authordata->$field : '';
    110125
     126    /**
     127     * Filter the value of the requested user metadata.
     128     *
     129     * The filter name is dynamic and depends on the $field parameter of the function.
     130     *
     131     * @since 2.8.0
     132     *
     133     * @param string $value   The value of the metadata.
     134     * @param int    $user_id The user ID.
     135     */
    111136    return apply_filters( 'get_the_author_' . $field, $value, $user_id );
    112137}
     
    120145 * @echo string The author's field from the current author's DB object.
    121146 */
    122 function the_author_meta($field = '', $user_id = false) {
    123     echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id), $user_id);
     147function the_author_meta( $field = '', $user_id = false ) {
     148    $author_meta = get_the_author_meta( $field, $user_id );
     149
     150    /**
     151     * The value of the requested user metadata.
     152     *
     153     * The filter name is dynamic and depends on the $field parameter of the function.
     154     *
     155     * @since 2.8.0
     156     *
     157     * @param string $author_meta The value of the metadata.
     158     * @param int    $user_id     The user ID.
     159     */
     160    echo apply_filters( 'the_author_' . $field, $author_meta, $user_id );
    124161}
    125162
     
    205242        get_the_author()
    206243    );
     244
     245    /**
     246     * Filter the link to the author page of the author of the current post.
     247     *
     248     * @since 2.9.0
     249     *
     250     * @param string $link HTML link.
     251     */
    207252    echo apply_filters( 'the_author_posts_link', $link );
    208253}
     
    233278    }
    234279
    235     $link = apply_filters('author_link', $link, $author_id, $author_nicename);
     280    /**
     281     * Filter the URL to the author's page.
     282     *
     283     * @since 2.1.0
     284     *
     285     * @param string $link            The URL to the author's page.
     286     * @param int    $author_id       The author's id.
     287     * @param string $author_nicename The author's nice name.
     288     */
     289    $link = apply_filters( 'author_link', $link, $author_id, $author_nicename );
    236290
    237291    return $link;
     
    379433    }
    380434
     435    /**
     436     * Filter whether the site has more than one author with published posts.
     437     *
     438     * @since 3.2.0
     439     *
     440     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     441     */
    381442    return apply_filters( 'is_multi_author', (bool) $is_multi_author );
    382443}
Note: See TracChangeset for help on using the changeset viewer.