~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-includes/author-template.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        global $authordata;
25
25
 
26
26
        if ( !empty( $deprecated ) )
27
 
                _deprecated_argument( __FUNCTION__, '2.1' );
 
27
                _deprecated_argument( __FUNCTION__, '2.1.0' );
28
28
 
29
29
        /**
30
 
         * Filter the display name of the current post's author.
 
30
         * Filters the display name of the current post's author.
31
31
         *
32
32
         * @since 2.9.0
33
33
         *
45
45
 * still use the old behavior will also pass the value from get_the_author().
46
46
 *
47
47
 * The normal, expected behavior of this function is to echo the author and not
48
 
 * return it. However, backwards compatibility has to be maintained.
 
48
 * return it. However, backward compatibility has to be maintained.
49
49
 *
50
50
 * @since 0.71
51
51
 * @see get_the_author()
57
57
 */
58
58
function the_author( $deprecated = '', $deprecated_echo = true ) {
59
59
        if ( ! empty( $deprecated ) ) {
60
 
                _deprecated_argument( __FUNCTION__, '2.1' );
 
60
                _deprecated_argument( __FUNCTION__, '2.1.0' );
61
61
        }
62
62
 
63
63
        if ( true !== $deprecated_echo ) {
64
 
                _deprecated_argument( __FUNCTION__, '1.5',
 
64
                _deprecated_argument( __FUNCTION__, '1.5.0',
65
65
                        /* translators: %s: get_the_author() */
66
66
                        sprintf( __( 'Use %s instead if you do not want the value echoed.' ),
67
67
                                '<code>get_the_author()</code>'
88
88
                $last_user = get_userdata($last_id);
89
89
 
90
90
                /**
91
 
                 * Filter the display name of the author who last edited the current post.
 
91
                 * Filters the display name of the author who last edited the current post.
92
92
                 *
93
93
                 * @since 2.8.0
94
94
                 *
137
137
        $value = isset( $authordata->$field ) ? $authordata->$field : '';
138
138
 
139
139
        /**
140
 
         * Filter the value of the requested user metadata.
 
140
         * Filters the value of the requested user metadata.
141
141
         *
142
142
         * The filter name is dynamic and depends on the $field parameter of the function.
143
143
         *
258
258
        );
259
259
 
260
260
        /**
261
 
         * Filter the link to the author page of the author of the current post.
 
261
         * Filters the link to the author page of the author of the current post.
262
262
         *
263
263
         * @since 2.9.0
264
264
         *
277
277
 */
278
278
function the_author_posts_link( $deprecated = '' ) {
279
279
        if ( ! empty( $deprecated ) ) {
280
 
                _deprecated_argument( __FUNCTION__, '2.1' );
 
280
                _deprecated_argument( __FUNCTION__, '2.1.0' );
281
281
        }
282
282
        echo get_the_author_posts_link();
283
283
}
312
312
        }
313
313
 
314
314
        /**
315
 
         * Filter the URL to the author's page.
 
315
         * Filters the URL to the author's page.
316
316
         *
317
317
         * @since 2.1.0
318
318
         *
337
337
 * @param string|array $args {
338
338
 *     Optional. Array or string of default arguments.
339
339
 *
340
 
 *     @type string $orderby       How to sort the authors. Accepts 'nicename', 'email', 'url', 'registered',
341
 
 *                                 'user_nicename', 'user_email', 'user_url', 'user_registered', 'name',
342
 
 *                                 'display_name', 'post_count', 'ID', 'meta_value', 'user_login'. Default 'name'.
343
 
 *     @type string $order         Sorting direction for $orderby. Accepts 'ASC', 'DESC'. Default 'ASC'.
344
 
 *     @type int    $number        Maximum authors to return or display. Default empty (all authors).
345
 
 *     @type bool   $optioncount   Show the count in parenthesis next to the author's name. Default false.
346
 
 *     @type bool   $exclude_admin Whether to exclude the 'admin' account, if it exists. Default false.
347
 
 *     @type bool   $show_fullname Whether to show the author's full name. Default false.
348
 
 *     @type bool   $hide_empty    Whether to hide any authors with no posts. Default true.
349
 
 *     @type string $feed          If not empty, show a link to the author's feed and use this text as the alt
350
 
 *                                 parameter of the link. Default empty.
351
 
 *     @type string $feed_image    If not empty, show a link to the author's feed and use this image URL as
352
 
 *                                 clickable anchor. Default empty.
353
 
 *     @type string $feed_type     The feed type to link to, such as 'rss2'. Defaults to default feed type.
354
 
 *     @type bool   $echo          Whether to output the result or instead return it. Default true.
355
 
 *     @type string $style         If 'list', each author is wrapped in an `<li>` element, otherwise the authors
356
 
 *                                 will be separated by commas.
357
 
 *     @type bool   $html          Whether to list the items in HTML form or plaintext. Default true.
358
 
 *     @type string $exclude       An array, comma-, or space-separated list of author IDs to exclude. Default empty.
359
 
 *     @type string $exclude       An array, comma-, or space-separated list of author IDs to include. Default empty.
 
340
 *     @type string       $orderby       How to sort the authors. Accepts 'nicename', 'email', 'url', 'registered',
 
341
 *                                       'user_nicename', 'user_email', 'user_url', 'user_registered', 'name',
 
342
 *                                       'display_name', 'post_count', 'ID', 'meta_value', 'user_login'. Default 'name'.
 
343
 *     @type string       $order         Sorting direction for $orderby. Accepts 'ASC', 'DESC'. Default 'ASC'.
 
344
 *     @type int          $number        Maximum authors to return or display. Default empty (all authors).
 
345
 *     @type bool         $optioncount   Show the count in parenthesis next to the author's name. Default false.
 
346
 *     @type bool         $exclude_admin Whether to exclude the 'admin' account, if it exists. Default false.
 
347
 *     @type bool         $show_fullname Whether to show the author's full name. Default false.
 
348
 *     @type bool         $hide_empty    Whether to hide any authors with no posts. Default true.
 
349
 *     @type string       $feed          If not empty, show a link to the author's feed and use this text as the alt
 
350
 *                                       parameter of the link. Default empty.
 
351
 *     @type string       $feed_image    If not empty, show a link to the author's feed and use this image URL as
 
352
 *                                       clickable anchor. Default empty.
 
353
 *     @type string       $feed_type     The feed type to link to, such as 'rss2'. Defaults to default feed type.
 
354
 *     @type bool         $echo          Whether to output the result or instead return it. Default true.
 
355
 *     @type string       $style         If 'list', each author is wrapped in an `<li>` element, otherwise the authors
 
356
 *                                       will be separated by commas.
 
357
 *     @type bool         $html          Whether to list the items in HTML form or plaintext. Default true.
 
358
 *     @type array|string $exclude       Array or comma/space-separated list of author IDs to exclude. Default empty.
 
359
 *     @type array|string $include       Array or comma/space-separated list of author IDs to include. Default empty.
360
360
 * }
361
361
 * @return string|void The output, if echo is set to false.
362
362
 */
480
480
        }
481
481
 
482
482
        /**
483
 
         * Filter whether the site has more than one author with published posts.
 
483
         * Filters whether the site has more than one author with published posts.
484
484
         *
485
485
         * @since 3.2.0
486
486
         *