Make WordPress Core

Changeset 37258


Ignore:
Timestamp:
04/20/2016 02:36:57 PM (8 years ago)
Author:
DrewAPicture
Message:

Docs: Notate more optional parameter defaults for a variety of function DocBlocks in wp-includes/link-template.php.

See #30406.

File:
1 edited

Legend:

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

    r37254 r37258  
    26122612 * @global WP_Rewrite $wp_rewrite
    26132613 *
    2614  * @param int $pagenum  Optional. Page number.
    2615  * @param int $max_page Optional. The maximum number of comment pages.
     2614 * @param int $pagenum  Optional. Page number. Default 1.
     2615 * @param int $max_page Optional. The maximum number of comment pages. Default 0.
    26162616 * @return string The comments page number link URL.
    26172617 */
     
    26562656 * @global WP_Query $wp_query
    26572657 *
    2658  * @param string $label    Optional. Label for link text.
    2659  * @param int    $max_page Optional. Max page.
     2658 * @param string $label    Optional. Label for link text. Default empty.
     2659 * @param int    $max_page Optional. Max page. Default 0.
    26602660 * @return string|void HTML-formatted link for the next page of comments.
    26612661 */
     
    27012701 * @since 2.7.0
    27022702 *
    2703  * @param string $label    Optional. Label for link text.
    2704  * @param int    $max_page Optional. Max page.
     2703 * @param string $label    Optional. Label for link text. Default empty.
     2704 * @param int    $max_page Optional. Max page. Default 0.
    27052705 */
    27062706function next_comments_link( $label = '', $max_page = 0 ) {
     
    27132713 * @since 2.7.1
    27142714 *
    2715  * @param string $label Optional. Label for comments link text.
     2715 * @param string $label Optional. Label for comments link text. Default empty.
    27162716 * @return string|void HTML-formatted link for the previous page of comments.
    27172717 */
     
    27452745 * @since 2.7.0
    27462746 *
    2747  * @param string $label Optional. Label for comments link text.
     2747 * @param string $label Optional. Label for comments link text. Default empty.
    27482748 */
    27492749function previous_comments_link( $label = '' ) {
     
    27592759 * @global WP_Rewrite $wp_rewrite
    27602760 *
    2761  * @param string|array $args Optional args. See paginate_links().
     2761 * @param string|array $args Optional args. See paginate_links(). Default empty array.
    27622762 * @return string|void Markup for pagination links.
    27632763 */
    2764 function paginate_comments_links($args = array()) {
     2764function paginate_comments_links( $args = array() ) {
    27652765    global $wp_rewrite;
    27662766
     
    28002800 *     Optional. Default comments navigation arguments.
    28012801 *
    2802  *     @type string $prev_text          Anchor text to display in the previous comments link. Default 'Older comments'.
    2803  *     @type string $next_text          Anchor text to display in the next comments link. Default 'Newer comments'.
     2802 *     @type string $prev_text          Anchor text to display in the previous comments link.
     2803 *                                      Default 'Older comments'.
     2804 *     @type string $next_text          Anchor text to display in the next comments link.
     2805 *                                      Default 'Newer comments'.
    28042806 *     @type string $screen_reader_text Screen reader text for nav element. Default 'Comments navigation'.
    28052807 * }
     
    28392841 * @since 4.4.0
    28402842 *
    2841  * @param array $args See {@see get_the_comments_navigation()} for available arguments.
     2843 * @param array $args See get_the_comments_navigation() for available arguments. Default empty array.
    28422844 */
    28432845function the_comments_navigation( $args = array() ) {
     
    28832885 * @since 4.4.0
    28842886 *
    2885  * @param array $args See {@see get_the_comments_pagination()} for available arguments.
     2887 * @param array $args See get_the_comments_pagination() for available arguments. Default empty array.
    28862888 */
    28872889function the_comments_pagination( $args = array() ) {
     
    28932895 *
    28942896 * @since 2.6.0
     2897 *
     2898 * @global bool   $is_IE      Whether the browser matches an Internet Explorer user agent.
     2899 * @global string $wp_version WP version.
    28952900 *
    28962901 * @global bool          $is_IE
     
    30343039 * @since 3.0.0
    30353040 *
    3036  * @param string $path   Optional. Path relative to the site url.
     3041 * @param string $path   Optional. Path relative to the site url. Default empty.
    30373042 * @param string $scheme Optional. Scheme to give the site url context. See set_url_scheme().
    30383043 * @return string Site url link with optional path appended.
     
    30933098 *
    30943099 * @param string $path   Optional path relative to the admin url.
    3095  * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
     3100 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
     3101 *                       'http' or 'https' can be passed to force those schemes.
    30963102 * @return string Admin url link with optional path appended.
    30973103 */
     
    31093115 * @param string $scheme  Optional. The scheme to use. Accepts 'http' or 'https',
    31103116 *                        to force those schemes. Default 'admin', which obeys
    3111  *                        {@see force_ssl_admin()} and {@see is_ssl()}.
     3117 *                        force_ssl_admin() and is_ssl().
    31123118 * @return string Admin url link with optional path appended.
    31133119 */
     
    31353141 * @since 2.6.0
    31363142 *
    3137  * @param string $path   Optional. Path relative to the includes url.
    3138  * @param string $scheme Optional. Scheme to give the includes url context.
     3143 * @param string $path   Optional. Path relative to the includes url. Default empty.
     3144 * @param string $scheme Optional. Scheme to give the includes url context. Accepts
     3145 *                       'http', 'https', or 'relative'. Default null.
    31393146 * @return string Includes url link with optional path appended.
    31403147 */
     
    31623169 * @since 2.6.0
    31633170 *
    3164  * @param string $path Optional. Path relative to the content url.
     3171 * @param string $path Optional. Path relative to the content url. Default empty.
    31653172 * @return string Content url link with optional path appended.
    31663173 */
    3167 function content_url($path = '') {
     3174function content_url( $path = '' ) {
    31683175    $url = set_url_scheme( WP_CONTENT_URL );
    31693176
     
    32433250 * @since 3.0.0
    32443251 *
    3245  * @param string $path   Optional. Path relative to the site url.
    3246  * @param string $scheme Optional. Scheme to give the site url context. See set_url_scheme().
     3252 * @see set_url_scheme()
     3253 *
     3254 * @param string $path   Optional. Path relative to the site url. Default empty.
     3255 * @param string $scheme Optional. Scheme to give the site url context. Accepts
     3256 *                       'http', 'https', or 'relative'. Default null.
    32473257 * @return string Site url link with optional path appended.
    32483258 */
     
    32783288 * Retrieves the home URL for the current network.
    32793289 *
    3280  * Returns the home url with the appropriate protocol, 'https' {@see is_ssl()}
     3290 * Returns the home url with the appropriate protocol, 'https' is_ssl()
    32813291 * and 'http' otherwise. If `$scheme` is 'http' or 'https', `is_ssl()` is
    32823292 * overridden.
     
    33263336 * @since 3.0.0
    33273337 *
    3328  * @param string $path   Optional path relative to the admin url.
    3329  * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
     3338 * @param string $path   Optional path relative to the admin url. Default empty.
     3339 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
     3340 *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    33303341 * @return string Admin url link with optional path appended.
    33313342 */
     
    33563367 * @since 3.0.0
    33573368 *
    3358  * @param string $path   Optional path relative to the admin url.
    3359  * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
     3369 * @param string $path   Optional. Path relative to the admin url. Default empty.
     3370 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
     3371 *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    33603372 * @return string Admin url link with optional path appended.
    33613373 */
     
    33833395 * @since 3.1.0
    33843396 *
    3385  * @param string $path   Optional path relative to the admin url.
    3386  * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
     3397 * @param string $path   Optional. Path relative to the admin url. Default empty.
     3398 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
     3399 *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    33873400 * @return string Admin url link with optional path appended.
    33883401 */
    3389 function self_admin_url($path = '', $scheme = 'admin') {
     3402function self_admin_url( $path = '', $scheme = 'admin' ) {
    33903403    if ( is_network_admin() )
    33913404        return network_admin_url($path, $scheme);
     
    34463459 * Retrieves the URL to the user's dashboard.
    34473460 *
    3448  * If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site,
    3449  * the dashboard for the current site is returned. If the user cannot edit the current site, the dashboard to the user's
    3450  * primary site is returned.
     3461 * If a user does not belong to any site, the global user dashboard is used. If the user
     3462 * belongs to the current site, the dashboard for the current site is returned. If the user
     3463 * cannot edit the current site, the dashboard to the user's primary site is returned.
    34513464 *
    34523465 * @since 3.1.0
    34533466 *
    34543467 * @param int    $user_id Optional. User ID. Defaults to current user.
    3455  * @param string $path    Optional path relative to the dashboard. Use only paths known to both site and user admins.
    3456  * @param string $scheme  The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
     3468 * @param string $path    Optional path relative to the dashboard. Use only paths known to
     3469 *                        both site and user admins. Default empty.
     3470 * @param string $scheme  The scheme to use. Default is 'admin', which obeys force_ssl_admin()
     3471 *                        and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    34573472 * @return string Dashboard url link with optional path appended.
    34583473 */
     
    34983513 *
    34993514 * @param int    $user_id Optional. User ID. Defaults to current user.
    3500  * @param string $scheme  The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
    3501  *                        'http' or 'https' can be passed to force those schemes.
     3515 * @param string $scheme  Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
     3516 *                        and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    35023517 * @return string Dashboard url link with optional path appended.
    35033518 */
     
    35603575 * Returns a shortlink for a post, page, attachment, or site.
    35613576 *
    3562  * This function exists to provide a shortlink tag that all themes and plugins can target. A plugin must hook in to
    3563  * provide the actual shortlinks. Default shortlink support is limited to providing ?p= style links for posts.
    3564  * Plugins can short-circuit this function via the pre_get_shortlink filter or filter the output
    3565  * via the get_shortlink filter.
     3577 * This function exists to provide a shortlink tag that all themes and plugins can target.
     3578 * A plugin must hook in to provide the actual shortlinks. Default shortlink support is
     3579 * limited to providing ?p= style links for posts. Plugins can short-circuit this function
     3580 * via the {@see 'pre_get_shortlink'} filter or filter the output via the {@see 'get_shortlink'} filter.
    35663581 *
    35673582 * @since 3.0.0.
    35683583 *
    3569  * @param int    $id          A post or site id. Default is 0, which means the current post or site.
    3570  * @param string $context     Whether the id is a 'site' id, 'post' id, or 'media' id.
    3571  *                            If 'post', the post_type of the post is consulted.
    3572  *                            If 'query', the current query is consulted to determine the id and context.
    3573  *                            Default is 'post'.
    3574  * @param bool   $allow_slugs Whether to allow post slugs in the shortlink. It is up to the plugin how and whether to honor this.
    3575  * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks are not enabled.
    3576  */
    3577 function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) {
     3584 * @param int    $id          Optional. A post or site id. Default is 0, which means the current post or site.
     3585 * @param string $context     Optional. Whether the id is a 'site' id, 'post' id, or 'media' id. If 'post',
     3586 *                            the post_type of the post is consulted. If 'query', the current query is consulted
     3587 *                            to determine the id and context. Default 'post'.
     3588 * @param bool   $allow_slugs Optional. Whether to allow post slugs in the shortlink. It is up to the plugin how
     3589 *                            and whether to honor this. Default true.
     3590 * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks
     3591 *                are not enabled.
     3592 */
     3593function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) {
    35783594    /**
    35793595     * Filters whether to preempt generating a shortlink for the given post.
     
    36343650 * Injects rel=shortlink into the head if a shortlink is defined for the current page.
    36353651 *
    3636  * Attached to the wp_head action.
     3652 * Attached to the {@see 'wp_head'} action.
    36373653 *
    36383654 * @since 3.0.0
     
    36713687 * Must be called from inside "The Loop"
    36723688 *
    3673  * Call like the_shortlink(__('Shortlinkage FTW'))
     3689 * Call like the_shortlink( __( 'Shortlinkage FTW' ) )
    36743690 *
    36753691 * @since 3.0.0
     
    36773693 * @param string $text   Optional The link text or HTML to be displayed. Defaults to 'This is the short link.'
    36783694 * @param string $title  Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized post title.
    3679  * @param string $before Optional HTML to display before the link.
    3680  * @param string $after  Optional HTML to display after the link.
     3695 * @param string $before Optional HTML to display before the link. Default empty.
     3696 * @param string $after  Optional HTML to display after the link. Default empty.
    36813697 */
    36823698function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
Note: See TracChangeset for help on using the changeset viewer.