Changeset 32598
- Timestamp:
- 05/25/2015 05:17:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r32545 r32598 191 191 * @since 2.7.0 192 192 * 193 * @param bool ean$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. 195 195 */ 196 196 function get_search_form( $echo = true ) { … … 269 269 * 270 270 * @param string $redirect Optional path to redirect to on login/logout. 271 * @param bool ean $echoDefault 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. 273 273 */ 274 274 function wp_loginout($redirect = '', $echo = true) { … … 324 324 325 325 /** 326 * Returns the Log In URL.327 *328 326 * Returns the URL that allows the user to log in to the site. 329 327 * 330 328 * @since 2.7.0 331 329 * 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. 334 332 * @return string A log in URL. 335 333 */ … … 357 355 358 356 /** 359 * Returns the user registration URL.360 *361 357 * Returns the URL that allows the user to register on the site. 362 358 * … … 383 379 * 384 380 * @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. 386 382 */ 387 383 function wp_login_form( $args = array() ) { … … 478 474 479 475 /** 480 * Returns the Lost Password URL.481 *482 476 * Returns the URL that allows the user to retrieve the lost password 483 477 * … … 515 509 * 516 510 * @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 bool ean $echoDefault 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. 520 514 */ 521 515 function wp_register( $before = '<li>', $after = '</li>', $echo = true ) { 522 523 516 if ( ! is_user_logged_in() ) { 524 517 if ( get_option('users_can_register') ) … … 601 594 * @since 0.71 602 595 * 603 * @param string $show Blog info to retrieve. 596 * @global string $wp_version 597 * 598 * @param string $show Blog info to retrieve. 604 599 * @param string $filter How to filter what is retrieved. 605 600 * @return string Mostly string values, might be empty. 606 601 */ 607 602 function get_bloginfo( $show = '', $filter = 'raw' ) { 608 609 603 switch( $show ) { 610 604 case 'home' : // DEPRECATED … … 767 761 * @since 1.0.0 768 762 * 769 * @param string $sep Optional, default is '»'. 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 '»'. How to separate the various items within the page title. 768 * @param bool $display Optional, default is true. Whether to display or retrieve title. 771 769 * @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 = '»', $display = true, $seplocation = '') {770 * @return string|void String on retrieve. 771 */ 772 function wp_title( $sep = '»', $display = true, $seplocation = '' ) { 775 773 global $wp_locale, $page, $paged; 776 774 … … 917 915 * @since 0.71 918 916 * 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 */ 921 function single_post_title( $prefix = '', $display = true ) { 924 922 $_post = get_queried_object(); 925 923 … … 950 948 * @since 3.1.0 951 949 * 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| nullTitle 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. 955 953 */ 956 954 function post_type_archive_title( $prefix = '', $display = true ) { … … 993 991 * @since 0.71 994 992 * 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. 998 996 */ 999 997 function single_cat_title( $prefix = '', $display = true ) { … … 1014 1012 * @since 2.3.0 1015 1013 * 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. 1019 1017 */ 1020 1018 function single_tag_title( $prefix = '', $display = true ) { … … 1035 1033 * @since 3.1.0 1036 1034 * 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. 1040 1038 */ 1041 1039 function single_term_title( $prefix = '', $display = true ) { … … 1099 1097 * @since 0.71 1100 1098 * 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. 1104 1104 */ 1105 1105 function single_month_title($prefix = '', $display = true ) { … … 1271 1271 * @todo Properly document optional arguments as such 1272 1272 * 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. 1275 1275 * @param string $format Optional, default is 'html'. Can be 'link', 'option', 'html', or custom. 1276 1276 * @param string $before Optional. 1277 * @param string $after Optional.1277 * @param string $after Optional. 1278 1278 * @return string HTML link content for archive. 1279 1279 */ … … 1298 1298 * @param string $link_html The archive HTML link content. 1299 1299 */ 1300 $link_html = apply_filters( 'get_archives_link', $link_html ); 1301 1302 return $link_html; 1300 return apply_filters( 'get_archives_link', $link_html ); 1303 1301 } 1304 1302 … … 1309 1307 * 1310 1308 * @see get_archives_link() 1309 * 1310 * @global wpdb $wpdb 1311 * @global WP_Locale $wp_locale 1311 1312 * 1312 1313 * @param string|array $args { … … 1331 1332 * Default 'DESC'. 1332 1333 * } 1333 * @return string| null String when retrieving, null when displaying.1334 * @return string|void String when retrieving. 1334 1335 */ 1335 1336 function wp_get_archives( $args = '' ) { … … 1547 1548 * @since 1.0.0 1548 1549 * 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 * 1549 1557 * @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. 1552 1560 */ 1553 1561 function get_calendar($initial = true, $echo = true) { … … 1779 1787 * 1780 1788 * @since 1.0.1 1781 * @uses $allowedtags 1789 * 1790 * @global array $allowedtags 1782 1791 * 1783 1792 * @return string HTML allowed tags entity encoded. … … 1795 1804 $allowed .= '> '; 1796 1805 } 1797 return htmlentities( $allowed);1806 return htmlentities( $allowed ); 1798 1807 } 1799 1808 … … 1823 1832 * @since 0.71 1824 1833 * 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. 1826 1838 * @param string $before Optional. Output before the date. 1827 * @param string $after Optional. Output after the date.1828 * @param bool $echoOptional, 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. 1830 1842 */ 1831 1843 function the_date( $d = '', $before = '', $after = '', $echo = true ) { … … 1854 1866 return $the_date; 1855 1867 } 1856 1857 return null;1858 1868 } 1859 1869 … … 1901 1911 * @since 2.1.0 1902 1912 * 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. 1904 1914 * @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 */ 1919 function the_modified_date( $d = '', $before = '', $after = '', $echo = true ) { 1911 1920 $the_modified_date = $before . get_the_modified_date($d) . $after; 1912 1921 … … 2142 2151 * 2143 2152 * @since 0.71 2144 * @uses $wp_locale 2153 * 2154 * @global WP_Locale $wp_locale 2145 2155 */ 2146 2156 function the_weekday() { … … 2155 2165 * @param string $the_weekday 2156 2166 */ 2157 $the_weekday = apply_filters( 'the_weekday', $the_weekday ); 2158 echo $the_weekday; 2167 echo apply_filters( 'the_weekday', $the_weekday ); 2159 2168 } 2160 2169 … … 2166 2175 * 2167 2176 * @since 0.71 2177 * 2178 * @global WP_Locale $wp_locale 2179 * @global string|int|bool $currentday 2180 * @global string|int|bool $previousweekday 2168 2181 * 2169 2182 * @param string $before Optional Output before the date. … … 2381 2394 * @since 2.0.0 2382 2395 * 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 * 2383 2403 * @return bool 2384 2404 */ … … 2450 2470 * @since 3.3.0 2451 2471 * 2452 * @param string $content Initial content for the editor.2472 * @param string $content Initial content for the editor. 2453 2473 * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/. 2454 * @param array $settingsSee _WP_Editors::editor().2474 * @param array $settings See _WP_Editors::editor(). 2455 2475 */ 2456 2476 function wp_editor( $content, $editor_id, $settings = array() ) { … … 2470 2490 * 2471 2491 * @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. 2473 2493 * @return string 2474 2494 */ … … 2590 2610 * 2591 2611 * @since 2.1.0 2612 * 2613 * @global WP_Query $wp_query 2614 * @global WP_Rewrite $wp_rewrite 2592 2615 * 2593 2616 * @param string|array $args { … … 2613 2636 * @type string $after_page_number A string to append after the page number. Default empty. 2614 2637 * } 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. 2616 2639 */ 2617 2640 function paginate_links( $args = '' ) { … … 2771 2794 * @todo Properly document optional arguments as such 2772 2795 * 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 2778 2803 */ 2779 2804 function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) { … … 2795 2820 * 2796 2821 * @since 3.0.0 2822 * 2823 * @global string $wp_version 2797 2824 */ 2798 2825 function register_admin_color_schemes() { … … 2862 2889 * 2863 2890 * @param string $file file relative to wp-admin/ without its ".css" extension. 2891 * @return string 2864 2892 */ 2865 2893 function wp_admin_css_uri( $file = 'wp-admin' ) { … … 2897 2925 * 2898 2926 * @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. 2904 2931 */ 2905 2932 function 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 2911 2933 // For backward compatibility 2912 2934 $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file; 2913 2935 2914 if ( $wp_styles->query( $handle ) ) {2936 if ( wp_styles()->query( $handle ) ) { 2915 2937 if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately 2916 2938 wp_print_styles( $handle ); … … 3005 3027 * 3006 3028 * @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. 3008 3030 */ 3009 3031 function get_the_generator( $type = '' ) { … … 3081 3103 * @param mixed $checked One of the values to compare 3082 3104 * @param mixed $current (true) The other value to compare if not just true 3083 * @param bool $echoWhether to echo or just return the string3105 * @param bool $echo Whether to echo or just return the string 3084 3106 * @return string html attribute or empty string 3085 3107 */ … … 3096 3118 * 3097 3119 * @param mixed $selected One of the values to compare 3098 * @param mixed $current (true) The other value to compare if not just true3099 * @param bool $echoWhether to echo or just return the string3120 * @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 3100 3122 * @return string html attribute or empty string 3101 3123 */ … … 3112 3134 * 3113 3135 * @param mixed $disabled One of the values to compare 3114 * @param mixed $current (true) The other value to compare if not just true3115 * @param bool $echoWhether to echo or just return the string3136 * @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 3116 3138 * @return string html attribute or empty string 3117 3139 */ … … 3128 3150 * @access private 3129 3151 * 3130 * @param mixed $helperOne of the values to compare3131 * @param mixed $current (true) The other value to compare if not just true3132 * @param bool $echoWhether to echo or just return the string3133 * @param string $type The type of checked|selected|disabled we are doing3152 * @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 3134 3156 * @return string html attribute or empty string 3135 3157 */
Note: See TracChangeset
for help on using the changeset viewer.