Make WordPress Core

Changeset 37254


Ignore:
Timestamp:
04/20/2016 06:31:05 AM (8 years ago)
Author:
DrewAPicture
Message:

Docs: Notate 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

    r37252 r37254  
    12581258 * @since 2.3.0
    12591259 *
    1260  * @param int    $id      Optional. Post ID.
    1261  * @param string $context Optional, defaults to display. How to write the '&', defaults to '&'.
     1260 * @param int    $id      Optional. Post ID. Default is the ID of the global `$post`.
     1261 * @param string $context Optional. How to output the '&' character. Default '&'.
    12621262 * @return string|null The edit post link for the given post. null if the post type is invalid or does
    12631263 *                     not allow an editing UI.
     
    13061306 * @since 4.4.0 The `$class` argument was added.
    13071307 *
    1308  * @param string $text   Optional. Anchor text.
    1309  * @param string $before Optional. Display before edit link.
    1310  * @param string $after  Optional. Display after edit link.
    1311  * @param int    $id     Optional. Post ID.
    1312  * @param string $class  Optional. Add custom class to link.
     1308 * @param string $text   Optional. Anchor text. If null, default is 'Edit This'. Default null.
     1309 * @param string $before Optional. Display before edit link. Default empty.
     1310 * @param string $after  Optional. Display after edit link. Default empty.
     1311 * @param int    $id     Optional. Post ID. Default is the ID of the global `$post`.
     1312 * @param string $class  Optional. Add custom class to link. Default 'post-edit-link'.
    13131313 */
    13141314function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) {
     
    13461346 * @since 2.9.0
    13471347 *
    1348  * @param int    $id           Optional. Post ID.
     1348 * @param int    $id           Optional. Post ID. Default is the ID of the global `$post`.
    13491349 * @param string $deprecated   Not used.
    1350  * @param bool   $force_delete Whether to bypass trash and force deletion. Default is false.
     1350 * @param bool   $force_delete Optional. Whether to bypass trash and force deletion. Default false.
    13511351 * @return string|void The delete post link URL for the given post.
    13521352 */
     
    14121412 * @since 1.0.0
    14131413 *
    1414  * @param string $text   Optional. Anchor text.
    1415  * @param string $before Optional. Display before edit link.
    1416  * @param string $after  Optional. Display after edit link.
     1414 * @param string $text   Optional. Anchor text. If null, default is 'Edit This'. Default null.
     1415 * @param string $before Optional. Display before edit link. Default empty.
     1416 * @param string $after  Optional. Display after edit link. Default empty.
    14171417 */
    14181418function edit_comment_link( $text = null, $before = '', $after = '' ) {
     
    14461446 * @since 2.7.0
    14471447 *
    1448  * @param int|stdClass $link Optional. Bookmark ID.
     1448 * @param int|stdClass $link Optional. Bookmark ID. Default is the id of the current bookmark.
    14491449 * @return string|void The edit bookmark link URL.
    14501450 */
     
    14731473 * @since 2.7.0
    14741474 *
    1475  * @param string $link     Optional. Anchor text.
    1476  * @param string $before   Optional. Display before edit link.
    1477  * @param string $after    Optional. Display after edit link.
    1478  * @param int    $bookmark Optional. Bookmark ID.
     1475 * @param string $link     Optional. Anchor text. Default empty.
     1476 * @param string $before   Optional. Display before edit link. Default empty.
     1477 * @param string $after    Optional. Display after edit link. Default empty.
     1478 * @param int    $bookmark Optional. Bookmark ID. Default is the current bookmark.
    14791479 */
    14801480function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
     
    15431543 * @since 1.5.0
    15441544 *
    1545  * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term.
    1546  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1545 * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
     1546 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    15471547 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    1548  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
     1548 * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
     1549 *                             corresponding post exists.
    15491550 */
    15501551function get_previous_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
     
    15571558 * @since 1.5.0
    15581559 *
    1559  * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term.
    1560  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1560 * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
     1561 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    15611562 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    1562  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
     1563 * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
     1564 *                             corresponding post exists.
    15631565 */
    15641566function get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
     
    15751577 * @global wpdb $wpdb WordPress database abstraction object.
    15761578 *
    1577  * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term.
    1578  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
    1579  * @param bool         $previous       Optional. Whether to retrieve previous post.
     1579 * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
     1580 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1581 * @param bool         $previous       Optional. Whether to retrieve previous post. Default true
    15801582 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    1581  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
     1583 * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
     1584 *                             corresponding post exists.
    15821585 */
    15831586function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
     
    17501753 * @since 2.8.0
    17511754 *
    1752  * @param string       $title          Optional. Link title format.
    1753  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1754  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1755 * @param string       $title          Optional. Link title format. Default '%title'.
     1756 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1757 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    17551758 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
    17561759 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    18001803 * @since 2.8.0
    18011804 *
    1802  * @param string       $title          Optional. Link title format.
    1803  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1804  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1805 * @param string       $title          Optional. Link title format. Default '%title'.
     1806 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1807 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    18051808 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    18061809 */
     
    18131816 * Displays relational links for the posts adjacent to the current post for single post pages.
    18141817 *
    1815  * This is meant to be attached to actions like 'wp_head'. Do not call this directly in plugins or theme templates.
     1818 * This is meant to be attached to actions like 'wp_head'. Do not call this directly in plugins
     1819 * or theme templates.
     1820 *
    18161821 * @since 3.0.0
    18171822 *
     1823 * @see adjacent_posts_rel_link()
    18181824 */
    18191825function adjacent_posts_rel_link_wp_head() {
     
    18291835 * @since 2.8.0
    18301836 *
    1831  * @param string       $title          Optional. Link title format.
    1832  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1833  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1837 * @see get_adjacent_post_rel_link()
     1838 *
     1839 * @param string       $title          Optional. Link title format. Default '%title'.
     1840 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1841 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    18341842 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    18351843 */
     
    18431851 * @since 2.8.0
    18441852 *
    1845  * @param string       $title          Optional. Link title format.
    1846  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
     1853 * @see get_adjacent_post_rel_link()
     1854 *
     1855 * @param string       $title          Optional. Link title format. Default '%title'.
     1856 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    18471857 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true.
    18481858 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    18611871 *
    18621872 * @param bool         $in_same_term   Optional. Whether returned post should be in a same taxonomy term.
     1873 *                                     Default false.
    18631874 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
    1864  * @param bool         $start          Optional. Whether to retrieve first or last post.
     1875 *                                     Default empty.
     1876 * @param bool         $start          Optional. Whether to retrieve first or last post. Default true
    18651877 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    18661878 * @return null|array Array containing the boundary post object if successful, null otherwise.
     
    19151927 * @since 3.7.0
    19161928 *
    1917  * @param string       $format         Optional. Link anchor format.
    1918  * @param string       $link           Optional. Link permalink format.
    1919  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1920  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1929 * @param string       $format         Optional. Link anchor format. Default '« %link'.
     1930 * @param string       $link           Optional. Link permalink format. Default '%title%'.
     1931 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1932 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    19211933 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    19221934 * @return string The link URL of the previous post in relation to the current post.
     
    19331945 * @see get_previous_post_link()
    19341946 *
    1935  * @param string       $format         Optional. Link anchor format.
    1936  * @param string       $link           Optional. Link permalink format.
    1937  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1938  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1947 * @param string       $format         Optional. Link anchor format. Default '« %link'.
     1948 * @param string       $link           Optional. Link permalink format. Default '%title'.
     1949 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1950 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    19391951 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    19401952 */
     
    19481960 * @since 3.7.0
    19491961 *
    1950  * @param string       $format         Optional. Link anchor format.
    1951  * @param string       $link           Optional. Link permalink format.
    1952  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1953  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1962 * @param string       $format         Optional. Link anchor format. Default '« %link'.
     1963 * @param string       $link           Optional. Link permalink format. Default '%title'.
     1964 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1965 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    19541966 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    19551967 * @return string The link URL of the next post in relation to the current post.
     
    19651977 * @see get_next_post_link()
    19661978 *
    1967  * @param string       $format         Optional. Link anchor format.
    1968  * @param string       $link           Optional. Link permalink format.
    1969  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1970  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     1979 * @param string       $format         Optional. Link anchor format. Default '« %link'.
     1980 * @param string       $link           Optional. Link permalink format. Default '%title'
     1981 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1982 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    19711983 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    19721984 */
     
    19841996 * @param string       $format         Link anchor format.
    19851997 * @param string       $link           Link permalink format.
    1986  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    1987  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs.
     1998 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     1999 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. Default empty.
    19882000 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
    19892001 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    20472059 * @param string       $format         Link anchor format.
    20482060 * @param string       $link           Link permalink format.
    2049  * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
    2050  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs.
     2061 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
     2062 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. Default empty.
    20512063 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
    20522064 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    20632075 * @global WP_Rewrite $wp_rewrite
    20642076 *
    2065  * @param int  $pagenum Optional. Page ID.
     2077 * @param int  $pagenum Optional. Page ID. Default 1.
    20662078 * @param bool $escape  Optional. Whether to escape the URL for display, with esc_url(). Defaults to true.
    20672079 *                      Otherwise, prepares the URL with esc_url_raw().
     
    21412153 * @global int $paged
    21422154 *
    2143  * @param int $max_page Optional. Max pages.
     2155 * @param int $max_page Optional. Max pages. Default 0.
    21442156 * @return string|void The link URL for next posts page.
    21452157 */
     
    21612173 * @since 0.71
    21622174 *
    2163  * @param int   $max_page Optional. Max pages.
    2164  * @param bool  $echo     Optional. Echo or return;
     2175 * @param int   $max_page Optional. Max pages. Default 0.
     2176 * @param bool  $echo     Optional. Whether to echo the link. Default true.
    21652177 * @return string|void The link URL for next posts page if `$echo = false`.
    21662178 */
     
    21832195 *
    21842196 * @param string $label    Content for link text.
    2185  * @param int    $max_page Optional. Max pages.
     2197 * @param int    $max_page Optional. Max pages. Default 0.
    21862198 * @return string|void HTML-formatted next posts page link.
    21872199 */
     
    22202232 *
    22212233 * @param string $label    Content for link text.
    2222  * @param int    $max_page Optional. Max pages.
     2234 * @param int    $max_page Optional. Max pages. Default 0.
    22232235 */
    22242236function next_posts_link( $label = null, $max_page = 0 ) {
     
    22552267 * @since 0.71
    22562268 *
    2257  * @param bool $echo Optional. Echo or return;
     2269 * @param bool $echo Optional. Whether to echo the link. Default true.
    22582270 * @return string|void The previous posts page link if `$echo = false`.
    22592271 */
     
    23142326 * @global WP_Query $wp_query
    23152327 *
    2316  * @param string|array $args Optional args.
     2328 * @param string|array $args {
     2329 *     Optional. Arguments to build the post pages link navigation.
     2330 *
     2331 *     @type string $sep      Separator character. Default '—'.
     2332 *     @type string $prelabel Link text to display for the previous page link.
     2333 *                            Default '« Previous Page'.
     2334 *     @type string $nxtlabel Link text to display for the next page link.
     2335 *                            Default 'Next Page »'.
     2336 * }
    23172337 * @return string The posts link navigation.
    23182338 */
     
    23532373 * @since 0.71
    23542374 *
    2355  * @param string $sep      Optional. Separator for posts navigation links.
    2356  * @param string $prelabel Optional. Label for previous pages.
    2357  * @param string $nxtlabel Optional Label for next pages.
     2375 * @param string $sep      Optional. Separator for posts navigation links. Default empty.
     2376 * @param string $prelabel Optional. Label for previous pages. Default empty.
     2377 * @param string $nxtlabel Optional Label for next pages. Default empty.
    23582378 */
    23592379function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {
     
    24212441 * @since 4.1.0
    24222442 *
    2423  * @param array $args Optional. See {@see get_the_post_navigation()} for available
    2424  *                    arguments. Default empty array.
     2443 * @param array $args Optional. See get_the_post_navigation() for available arguments.
     2444 *                    Default empty array.
    24252445 */
    24262446function the_post_navigation( $args = array() ) {
     
    24802500 * @since 4.1.0
    24812501 *
    2482  * @param array $args Optional. See {@see get_the_posts_navigation()} for available
    2483  *                    arguments. Default empty array.
     2502 * @param array $args Optional. See get_the_posts_navigation() for available arguments.
     2503 *                    Default empty array.
    24842504 */
    24852505function the_posts_navigation( $args = array() ) {
     
    24932513 *
    24942514 * @param array $args {
    2495  *     Optional. Default pagination arguments, {@see paginate_links()}.
     2515 *     Optional. Default pagination arguments, see paginate_links().
    24962516 *
    24972517 *     @type string $screen_reader_text Screen reader text for navigation element.
     
    25332553 * @since 4.1.0
    25342554 *
    2535  * @param array $args Optional. See {@see get_the_posts_pagination()} for available arguments.
     2555 * @param array $args Optional. See get_the_posts_pagination() for available arguments.
    25362556 *                    Default empty array.
    25372557 */
Note: See TracChangeset for help on using the changeset viewer.