Make WordPress Core

Changeset 32598


Ignore:
Timestamp:
05/25/2015 05:17:23 PM (10 years ago)
Author:
wonderboymusic
Message:

Cleanup doc blocks in general-template.php.

See #32444.

File:
1 edited

Legend:

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

    r32545 r32598  
    191191 * @since 2.7.0
    192192 *
    193  * @param boolean $echo Default to echo and not return the form.
    194  * @return string|null String when retrieving, null when displaying or if searchform.php exists.
     193 * @param bool $echo Default to echo and not return the form.
     194 * @return string|void String when $echo is false.
    195195 */
    196196function get_search_form( $echo = true ) {
     
    269269 *
    270270 * @param string $redirect Optional path to redirect to on login/logout.
    271  * @param boolean $echo Default to echo and not return the link.
    272  * @return string|null String when retrieving, null when displaying.
     271 * @param bool   $echo    Default to echo and not return the link.
     272 * @return string|void String when retrieving.
    273273 */
    274274function wp_loginout($redirect = '', $echo = true) {
     
    324324
    325325/**
    326  * Returns the Log In URL.
    327  *
    328326 * Returns the URL that allows the user to log in to the site.
    329327 *
    330328 * @since 2.7.0
    331329 *
    332  * @param string $redirect Path to redirect to on login.
    333  * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
     330 * @param string $redirect     Path to redirect to on login.
     331 * @param bool   $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
    334332 * @return string A log in URL.
    335333 */
     
    357355
    358356/**
    359  * Returns the user registration URL.
    360  *
    361357 * Returns the URL that allows the user to register on the site.
    362358 *
     
    383379 *
    384380 * @param array $args Configuration options to modify the form output.
    385  * @return string|null String when retrieving, null when displaying.
     381 * @return string|void String when retrieving.
    386382 */
    387383function wp_login_form( $args = array() ) {
     
    478474
    479475/**
    480  * Returns the Lost Password URL.
    481  *
    482476 * Returns the URL that allows the user to retrieve the lost password
    483477 *
     
    515509 *
    516510 * @param string $before Text to output before the link. Default `<li>`.
    517  * @param string $after Text to output after the link. Default `</li>`.
    518  * @param boolean $echo Default to echo and not return the link.
    519  * @return string|null String when retrieving, null when displaying.
     511 * @param string $after  Text to output after the link. Default `</li>`.
     512 * @param bool   $echo  Default to echo and not return the link.
     513 * @return string|void String when retrieving.
    520514 */
    521515function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {
    522 
    523516    if ( ! is_user_logged_in() ) {
    524517        if ( get_option('users_can_register') )
     
    601594 * @since 0.71
    602595 *
    603  * @param string $show Blog info to retrieve.
     596 * @global string $wp_version
     597 *
     598 * @param string $show   Blog info to retrieve.
    604599 * @param string $filter How to filter what is retrieved.
    605600 * @return string Mostly string values, might be empty.
    606601 */
    607602function get_bloginfo( $show = '', $filter = 'raw' ) {
    608 
    609603    switch( $show ) {
    610604        case 'home' : // DEPRECATED
     
    767761 * @since 1.0.0
    768762 *
    769  * @param string $sep Optional, default is '&raquo;'. How to separate the various items within the page title.
    770  * @param bool $display Optional, default is true. Whether to display or retrieve title.
     763 * @global WP_Locale $wp_locale
     764 * @global int       $page
     765 * @global int       $paged
     766 *
     767 * @param string $sep         Optional, default is '&raquo;'. How to separate the various items within the page title.
     768 * @param bool   $display     Optional, default is true. Whether to display or retrieve title.
    771769 * @param string $seplocation Optional. Direction to display title, 'right'.
    772  * @return string|null String on retrieve, null when displaying.
    773  */
    774 function wp_title($sep = '&raquo;', $display = true, $seplocation = '') {
     770 * @return string|void String on retrieve.
     771 */
     772function wp_title( $sep = '&raquo;', $display = true, $seplocation = '' ) {
    775773    global $wp_locale, $page, $paged;
    776774
     
    917915 * @since 0.71
    918916 *
    919  * @param string $prefix Optional. What to display before the title.
    920  * @param bool $display Optional, default is true. Whether to display or retrieve title.
    921  * @return string|null Title when retrieving, null when displaying or failure.
    922  */
    923 function single_post_title($prefix = '', $display = true) {
     917 * @param string $prefix  Optional. What to display before the title.
     918 * @param bool   $display Optional, default is true. Whether to display or retrieve title.
     919 * @return string|void Title when retrieving.
     920 */
     921function single_post_title( $prefix = '', $display = true ) {
    924922    $_post = get_queried_object();
    925923
     
    950948 * @since 3.1.0
    951949 *
    952  * @param string $prefix Optional. What to display before the title.
    953  * @param bool $display Optional, default is true. Whether to display or retrieve title.
    954  * @return string|null Title when retrieving, null when displaying or failure.
     950 * @param string $prefix  Optional. What to display before the title.
     951 * @param bool   $display Optional, default is true. Whether to display or retrieve title.
     952 * @return string|void Title when retrieving, null when displaying or failure.
    955953 */
    956954function post_type_archive_title( $prefix = '', $display = true ) {
     
    993991 * @since 0.71
    994992 *
    995  * @param string $prefix Optional. What to display before the title.
    996  * @param bool $display Optional, default is true. Whether to display or retrieve title.
    997  * @return string|null Title when retrieving, null when displaying or failure.
     993 * @param string $prefix  Optional. What to display before the title.
     994 * @param bool   $display Optional, default is true. Whether to display or retrieve title.
     995 * @return string|void Title when retrieving.
    998996 */
    999997function single_cat_title( $prefix = '', $display = true ) {
     
    10141012 * @since 2.3.0
    10151013 *
    1016  * @param string $prefix Optional. What to display before the title.
    1017  * @param bool $display Optional, default is true. Whether to display or retrieve title.
    1018  * @return string|null Title when retrieving, null when displaying or failure.
     1014 * @param string $prefix  Optional. What to display before the title.
     1015 * @param bool   $display Optional, default is true. Whether to display or retrieve title.
     1016 * @return string|void Title when retrieving.
    10191017 */
    10201018function single_tag_title( $prefix = '', $display = true ) {
     
    10351033 * @since 3.1.0
    10361034 *
    1037  * @param string $prefix Optional. What to display before the title.
    1038  * @param bool $display Optional, default is true. Whether to display or retrieve title.
    1039  * @return string|null Title when retrieving, null when displaying or failure.
     1035 * @param string $prefix  Optional. What to display before the title.
     1036 * @param bool   $display Optional, default is true. Whether to display or retrieve title.
     1037 * @return string|void Title when retrieving.
    10401038 */
    10411039function single_term_title( $prefix = '', $display = true ) {
     
    10991097 * @since 0.71
    11001098 *
    1101  * @param string $prefix Optional. What to display before the title.
    1102  * @param bool $display Optional, default is true. Whether to display or retrieve title.
    1103  * @return string|null Title when retrieving, null when displaying or failure.
     1099 * @global WP_Locale $wp_locale
     1100 *
     1101 * @param string $prefix  Optional. What to display before the title.
     1102 * @param bool   $display Optional, default is true. Whether to display or retrieve title.
     1103 * @return string|void Title when retrieving.
    11041104 */
    11051105function single_month_title($prefix = '', $display = true ) {
     
    12711271 * @todo Properly document optional arguments as such
    12721272 *
    1273  * @param string $url URL to archive.
    1274  * @param string $text Archive text description.
     1273 * @param string $url    URL to archive.
     1274 * @param string $text   Archive text description.
    12751275 * @param string $format Optional, default is 'html'. Can be 'link', 'option', 'html', or custom.
    12761276 * @param string $before Optional.
    1277  * @param string $after Optional.
     1277 * @param string $after  Optional.
    12781278 * @return string HTML link content for archive.
    12791279 */
     
    12981298     * @param string $link_html The archive HTML link content.
    12991299     */
    1300     $link_html = apply_filters( 'get_archives_link', $link_html );
    1301 
    1302     return $link_html;
     1300    return apply_filters( 'get_archives_link', $link_html );
    13031301}
    13041302
     
    13091307 *
    13101308 * @see get_archives_link()
     1309 *
     1310 * @global wpdb      $wpdb
     1311 * @global WP_Locale $wp_locale
    13111312 *
    13121313 * @param string|array $args {
     
    13311332 *                                       Default 'DESC'.
    13321333 * }
    1333  * @return string|null String when retrieving, null when displaying.
     1334 * @return string|void String when retrieving.
    13341335 */
    13351336function wp_get_archives( $args = '' ) {
     
    15471548 * @since 1.0.0
    15481549 *
     1550 * @global wpdb      $wpdb
     1551 * @global int       $m
     1552 * @global int       $monthnum
     1553 * @global int       $year
     1554 * @global WP_Locale $wp_locale
     1555 * @global array     $posts
     1556 *
    15491557 * @param bool $initial Optional, default is true. Use initial calendar names.
    1550  * @param bool $echo Optional, default is true. Set to false for return.
    1551  * @return string|null String when retrieving, null when displaying.
     1558 * @param bool $echo    Optional, default is true. Set to false for return.
     1559 * @return string|void String when retrieving.
    15521560 */
    15531561function get_calendar($initial = true, $echo = true) {
     
    17791787 *
    17801788 * @since 1.0.1
    1781  * @uses $allowedtags
     1789 *
     1790 * @global array $allowedtags
    17821791 *
    17831792 * @return string HTML allowed tags entity encoded.
     
    17951804        $allowed .= '> ';
    17961805    }
    1797     return htmlentities($allowed);
     1806    return htmlentities( $allowed );
    17981807}
    17991808
     
    18231832 * @since 0.71
    18241833 *
    1825  * @param string $d Optional. PHP date format defaults to the date_format option if not specified.
     1834 * @global string|int|bool $currentday
     1835 * @global string|int|bool $previousday
     1836 *
     1837 * @param string $d      Optional. PHP date format defaults to the date_format option if not specified.
    18261838 * @param string $before Optional. Output before the date.
    1827  * @param string $after Optional. Output after the date.
    1828  * @param bool $echo Optional, default is display. Whether to echo the date or return it.
    1829  * @return string|null Null if displaying, string if retrieving.
     1839 * @param string $after  Optional. Output after the date.
     1840 * @param bool   $echo  Optional, default is display. Whether to echo the date or return it.
     1841 * @return string|void String if retrieving.
    18301842 */
    18311843function the_date( $d = '', $before = '', $after = '', $echo = true ) {
     
    18541866            return $the_date;
    18551867    }
    1856 
    1857     return null;
    18581868}
    18591869
     
    19011911 * @since 2.1.0
    19021912 *
    1903  * @param string $d Optional. PHP date format defaults to the date_format option if not specified.
     1913 * @param string $d      Optional. PHP date format defaults to the date_format option if not specified.
    19041914 * @param string $before Optional. Output before the date.
    1905  * @param string $after Optional. Output after the date.
    1906  * @param bool $echo Optional, default is display. Whether to echo the date or return it.
    1907  * @return string|null Null if displaying, string if retrieving.
    1908  */
    1909 function the_modified_date($d = '', $before='', $after='', $echo = true) {
    1910 
     1915 * @param string $after  Optional. Output after the date.
     1916 * @param bool   $echo   Optional, default is display. Whether to echo the date or return it.
     1917 * @return string|void String if retrieving.
     1918 */
     1919function the_modified_date( $d = '', $before = '', $after = '', $echo = true ) {
    19111920    $the_modified_date = $before . get_the_modified_date($d) . $after;
    19121921
     
    21422151 *
    21432152 * @since 0.71
    2144  * @uses $wp_locale
     2153 *
     2154 * @global WP_Locale $wp_locale
    21452155 */
    21462156function the_weekday() {
     
    21552165     * @param string $the_weekday
    21562166     */
    2157     $the_weekday = apply_filters( 'the_weekday', $the_weekday );
    2158     echo $the_weekday;
     2167    echo apply_filters( 'the_weekday', $the_weekday );
    21592168}
    21602169
     
    21662175 *
    21672176 * @since 0.71
     2177 *
     2178 * @global WP_Locale       $wp_locale
     2179 * @global string|int|bool $currentday
     2180 * @global string|int|bool $previousweekday
    21682181 *
    21692182 * @param string $before Optional Output before the date.
     
    23812394 * @since 2.0.0
    23822395 *
     2396 * @global bool $wp_rich_edit
     2397 * @global bool $is_gecko
     2398 * @global bool $is_opera
     2399 * @global bool $is_safari
     2400 * @global bool $is_chrome
     2401 * @global bool $is_IE
     2402 *
    23832403 * @return bool
    23842404 */
     
    24502470 * @since 3.3.0
    24512471 *
    2452  * @param string $content Initial content for the editor.
     2472 * @param string $content   Initial content for the editor.
    24532473 * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/.
    2454  * @param array $settings See _WP_Editors::editor().
     2474 * @param array  $settings See _WP_Editors::editor().
    24552475 */
    24562476function wp_editor( $content, $editor_id, $settings = array() ) {
     
    24702490 *
    24712491 * @param bool $escaped Whether the result is escaped. Default true.
    2472  *  Only use when you are later escaping it. Do not use unescaped.
     2492 *                      Only use when you are later escaping it. Do not use unescaped.
    24732493 * @return string
    24742494 */
     
    25902610 *
    25912611 * @since 2.1.0
     2612 *
     2613 * @global WP_Query   $wp_query
     2614 * @global WP_Rewrite $wp_rewrite
    25922615 *
    25932616 * @param string|array $args {
     
    26132636 *     @type string $after_page_number  A string to append after the page number. Default empty.
    26142637 * }
    2615  * @return array|string String of page links or array of page links.
     2638 * @return array|string|void String of page links or array of page links.
    26162639 */
    26172640function paginate_links( $args = '' ) {
     
    27712794 * @todo Properly document optional arguments as such
    27722795 *
    2773  * @param string $key The unique key for this theme.
    2774  * @param string $name The name of the theme.
    2775  * @param string $url The url of the css file containing the colour scheme.
    2776  * @param array $colors Optional An array of CSS color definitions which are used to give the user a feel for the theme.
    2777  * @param array $icons Optional An array of CSS color definitions used to color any SVG icons
     2796 * @global array $_wp_admin_css_colors
     2797 *
     2798 * @param string $key    The unique key for this theme.
     2799 * @param string $name   The name of the theme.
     2800 * @param string $url    The url of the css file containing the colour scheme.
     2801 * @param array  $colors Optional An array of CSS color definitions which are used to give the user a feel for the theme.
     2802 * @param array  $icons  Optional An array of CSS color definitions used to color any SVG icons
    27782803 */
    27792804function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) {
     
    27952820 *
    27962821 * @since 3.0.0
     2822 *
     2823 * @global string $wp_version
    27972824 */
    27982825function register_admin_color_schemes() {
     
    28622889 *
    28632890 * @param string $file file relative to wp-admin/ without its ".css" extension.
     2891 * @return string
    28642892 */
    28652893function wp_admin_css_uri( $file = 'wp-admin' ) {
     
    28972925 *
    28982926 * @since 2.3.0
    2899  * @uses $wp_styles WordPress Styles Object
    2900  *
    2901  * @param string $file Optional. Style handle name or file name (without ".css" extension) relative
    2902  *   to wp-admin/. Defaults to 'wp-admin'.
    2903  * @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
     2927 *
     2928 * @param string $file       Optional. Style handle name or file name (without ".css" extension) relative
     2929 *                           to wp-admin/. Defaults to 'wp-admin'.
     2930 * @param bool   $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
    29042931 */
    29052932function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
    2906     global $wp_styles;
    2907     if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    2908         $wp_styles = new WP_Styles();
    2909     }
    2910 
    29112933    // For backward compatibility
    29122934    $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
    29132935
    2914     if ( $wp_styles->query( $handle ) ) {
     2936    if ( wp_styles()->query( $handle ) ) {
    29152937        if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
    29162938            wp_print_styles( $handle );
     
    30053027 *
    30063028 * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
    3007  * @return string The HTML content for the generator.
     3029 * @return string|void The HTML content for the generator.
    30083030 */
    30093031function get_the_generator( $type = '' ) {
     
    30813103 * @param mixed $checked One of the values to compare
    30823104 * @param mixed $current (true) The other value to compare if not just true
    3083  * @param bool $echo Whether to echo or just return the string
     3105 * @param bool  $echo    Whether to echo or just return the string
    30843106 * @return string html attribute or empty string
    30853107 */
     
    30963118 *
    30973119 * @param mixed $selected One of the values to compare
    3098  * @param mixed $current (true) The other value to compare if not just true
    3099  * @param bool $echo Whether to echo or just return the string
     3120 * @param mixed $current  (true) The other value to compare if not just true
     3121 * @param bool  $echo    Whether to echo or just return the string
    31003122 * @return string html attribute or empty string
    31013123 */
     
    31123134 *
    31133135 * @param mixed $disabled One of the values to compare
    3114  * @param mixed $current (true) The other value to compare if not just true
    3115  * @param bool $echo Whether to echo or just return the string
     3136 * @param mixed $current  (true) The other value to compare if not just true
     3137 * @param bool  $echo    Whether to echo or just return the string
    31163138 * @return string html attribute or empty string
    31173139 */
     
    31283150 * @access private
    31293151 *
    3130  * @param mixed $helper One of the values to compare
    3131  * @param mixed $current (true) The other value to compare if not just true
    3132  * @param bool $echo Whether to echo or just return the string
    3133  * @param string $type The type of checked|selected|disabled we are doing
     3152 * @param mixed  $helper One of the values to compare
     3153 * @param mixed  $current (true) The other value to compare if not just true
     3154 * @param bool   $echo    Whether to echo or just return the string
     3155 * @param string $type    The type of checked|selected|disabled we are doing
    31343156 * @return string html attribute or empty string
    31353157 */
Note: See TracChangeset for help on using the changeset viewer.