Changeset 28130 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 04/15/2014 04:00:48 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r27600 r28130 16 16 * "special". 17 17 * 18 * @since 1.5.0 19 * 18 20 * @uses locate_template() 19 * @since 1.5.020 * @uses do_action() Calls 'get_header' action.21 21 * 22 22 * @param string $name The name of the specialised header. 23 23 */ 24 24 function get_header( $name = null ) { 25 /** 26 * Fires before the header template file is loaded. 27 * 28 * The hook allows a specific header template file to be used in place of the 29 * default header template file. If your file is called header-new.php, 30 * you would specify the filename in the hook as get_header( 'new' ). 31 * 32 * @since 2.1.0 33 * @since 2.8.0 $name parameter added. 34 * 35 * @param string $name Name of the specific header file to use. 36 */ 25 37 do_action( 'get_header', $name ); 26 38 … … 46 58 * "special". 47 59 * 60 * @since 1.5.0 61 * 48 62 * @uses locate_template() 49 * @since 1.5.050 * @uses do_action() Calls 'get_footer' action.51 63 * 52 64 * @param string $name The name of the specialised footer. 53 65 */ 54 66 function get_footer( $name = null ) { 67 /** 68 * Fires before the footer template file is loaded. 69 * 70 * The hook allows a specific footer template file to be used in place of the 71 * default footer template file. If your file is called footer-new.php, 72 * you would specify the filename in the hook as get_footer( 'new' ). 73 * 74 * @since 2.1.0 75 * @since 2.8.0 $name parameter added. 76 * 77 * @param string $name Name of the specific footer file to use. 78 */ 55 79 do_action( 'get_footer', $name ); 56 80 … … 76 100 * "special". 77 101 * 102 * @since 1.5.0 103 * 78 104 * @uses locate_template() 79 * @since 1.5.080 * @uses do_action() Calls 'get_sidebar' action.81 105 * 82 106 * @param string $name The name of the specialised sidebar. 83 107 */ 84 108 function get_sidebar( $name = null ) { 109 /** 110 * Fires before the sidebar template file is loaded. 111 * 112 * The hook allows a specific sidebar template file to be used in place of the 113 * default sidebar template file. If your file is called sidebar-new.php, 114 * you would specify the filename in the hook as get_sidebar( 'new' ). 115 * 116 * @since 2.2.0 117 * @since 2.8.0 $name parameter added. 118 * 119 * @param string $name Name of the specific sidebar file to use. 120 */ 85 121 do_action( 'get_sidebar', $name ); 86 122 … … 113 149 * "special". 114 150 * 151 * @since 3.0.0 152 * 115 153 * @uses locate_template() 116 * @since 3.0.0117 * @uses do_action() Calls 'get_template_part_{$slug}' action.118 154 * 119 155 * @param string $slug The slug name for the generic template. … … 121 157 */ 122 158 function get_template_part( $slug, $name = null ) { 159 /** 160 * Fires before the specified template part file is loaded. 161 * 162 * The dynamic portion of the hook name, $slug, refers to the slug name 163 * for the generic template part. 164 * 165 * @since 3.0.0 166 * 167 * @param string $slug The slug name for the generic template. 168 * @param string $name The name of the specialized template. 169 */ 123 170 do_action( "get_template_part_{$slug}", $slug, $name ); 124 171 … … 151 198 * 152 199 * @since 2.7.0 153 * @uses apply_filters() Calls 'search_form_format' filter to determine which type to use for the search field.154 * If set to 'html5', it changes to search input type and adds placeholder text.155 200 * 156 201 * @param boolean $echo Default to echo and not return the form. … … 158 203 */ 159 204 function get_search_form( $echo = true ) { 205 /** 206 * Fires before the search form is retrieved, at the start of get_search_form(). 207 * 208 * @since 2.7.0 as 'get_search_form' action. 209 * @since 3.6.0 210 * 211 * @link https://core.trac.wordpress.org/ticket/19321 212 */ 160 213 do_action( 'pre_get_search_form' ); 161 214 162 215 $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml'; 216 217 /** 218 * Filter the HTML format of the search form. 219 * 220 * @since 3.6.0 221 * 222 * @param string $format The type of markup to use in the search form. 223 * Accepts 'html5', 'xhtml'. 224 */ 163 225 $format = apply_filters( 'search_form_format', $format ); 164 226 … … 188 250 } 189 251 252 /** 253 * Filter the HTML output of the search form. 254 * 255 * @since 2.7.0 256 * 257 * @param string $form The search form HTML output. 258 */ 190 259 $result = apply_filters( 'get_search_form', $form ); 260 191 261 if ( null === $result ) 192 262 $result = $form; … … 205 275 * 206 276 * @since 1.5.0 207 * @uses apply_filters() Calls 'loginout' hook on HTML link content.208 277 * 209 278 * @param string $redirect Optional path to redirect to on login/logout. … … 217 286 $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>'; 218 287 219 if ( $echo ) 220 echo apply_filters('loginout', $link); 221 else 222 return apply_filters('loginout', $link); 288 if ( $echo ) { 289 /** 290 * Filter the HTML output for the Log In/Log Out link. 291 * 292 * @since 1.5.0 293 * 294 * @param string $link The HTML link content. 295 */ 296 echo apply_filters( 'loginout', $link ); 297 } else { 298 /** This filter is documented in wp-includes/general-template.php */ 299 return apply_filters( 'loginout', $link ); 300 } 223 301 } 224 302 … … 229 307 * 230 308 * @since 2.7.0 309 * 231 310 * @uses wp_nonce_url() To protect against CSRF. 232 311 * @uses site_url() To generate the log out URL. 233 * @uses apply_filters() calls 'logout_url' hook on final logout URL.234 312 * 235 313 * @param string $redirect Path to redirect to on logout. … … 245 323 $logout_url = wp_nonce_url( $logout_url, 'log-out' ); 246 324 247 return apply_filters('logout_url', $logout_url, $redirect); 325 /** 326 * Filter the logout URL. 327 * 328 * @since 2.8.0 329 * 330 * @param string $logout_url The Log Out URL. 331 * @param string $redirect Path to redirect to on logout. 332 */ 333 return apply_filters( 'logout_url', $logout_url, $redirect ); 248 334 } 249 335 … … 254 340 * 255 341 * @since 2.7.0 342 * 256 343 * @uses site_url() To generate the log in URL. 257 * @uses apply_filters() calls 'login_url' hook on final login URL.258 344 * 259 345 * @param string $redirect Path to redirect to on login. … … 270 356 $login_url = add_query_arg('reauth', '1', $login_url); 271 357 272 return apply_filters('login_url', $login_url, $redirect); 358 /** 359 * Filter the login URL. 360 * 361 * @since 2.8.0 362 * 363 * @param string $login_url The login URL. 364 * @param string $redirect The path to redirect to on login, if supplied. 365 */ 366 return apply_filters( 'login_url', $login_url, $redirect ); 273 367 } 274 368 … … 279 373 * 280 374 * @since 3.6.0 375 * 281 376 * @uses site_url() To generate the registration URL. 282 * @uses apply_filters() calls 'register_url' hook on final URL. 283 * 284 * @return string 377 * 378 * @return string User registration URL. 285 379 */ 286 380 function wp_registration_url() { 381 /** 382 * Filter the user registration URL. 383 * 384 * @since 3.6.0 385 * 386 * @param string $register The user registration URL. 387 */ 287 388 return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) ); 288 389 } … … 293 394 * 294 395 * @since 3.0.0 396 * 295 397 * @param array $args Configuration options to modify the form output. 296 398 * @return string|null String when retrieving, null when displaying. … … 313 415 'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked 314 416 ); 417 418 /** 419 * Filter the default login form output arguments. 420 * 421 * @since 3.0.0 422 * 423 * @see wp_login_form() 424 * 425 * @param array $defaults An array of default login form arguments. 426 */ 315 427 $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) ); 316 428 … … 347 459 * 348 460 * @since 2.8.0 461 * 349 462 * @uses site_url() To generate the lost password URL 350 * @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url351 463 * 352 464 * @param string $redirect Path to redirect to on login. … … 360 472 361 473 $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') ); 474 475 /** 476 * Filter the Lost Password URL. 477 * 478 * @since 2.8.0 479 * 480 * @param string $lostpassword_url The lost password page URL. 481 * @param string $redirect The path to redirect to on login. 482 */ 362 483 return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect ); 363 484 } … … 370 491 * 371 492 * @since 1.5.0 372 * @uses apply_filters() Calls 'register' hook on register / admin link content.373 493 * 374 494 * @param string $before Text to output before the link (defaults to <li>). … … 388 508 } 389 509 390 if ( $echo ) 391 echo apply_filters('register', $link); 392 else 393 return apply_filters('register', $link); 510 if ( $echo ) { 511 /** 512 * Filter the HTML link to the Registration or Admin page. 513 * 514 * Users are sent to the admin page if logged-in, or the registration page 515 * if enabled and logged-out. 516 * 517 * @since 1.5.0 518 * 519 * @param string $link The HTML code for the link to the Registration or Admin page. 520 */ 521 echo apply_filters( 'register', $link ); 522 } else { 523 /** This filter is documented in wp-includes/general-template.php */ 524 return apply_filters( 'register', $link ); 525 } 394 526 } 395 527 … … 401 533 * 402 534 * @since 1.5.0 535 * 403 536 * @link http://trac.wordpress.org/ticket/1458 Explanation of 'wp_meta' action. 404 * @uses do_action() Calls 'wp_meta' hook.405 537 */ 406 538 function wp_meta() { 407 do_action('wp_meta'); 539 /** 540 * Fires before displaying echoed content in the sidebar. 541 * 542 * @since 1.5.0 543 */ 544 do_action( 'wp_meta' ); 408 545 } 409 546 … … 530 667 531 668 if ( 'display' == $filter ) { 532 if ( $url ) 533 $output = apply_filters('bloginfo_url', $output, $show); 534 else 535 $output = apply_filters('bloginfo', $output, $show); 669 if ( $url ) { 670 /** 671 * Filter the URL returned by get_bloginfo(). 672 * 673 * @since 2.0.5 674 * 675 * @param mixed $output The URL returned by bloginfo(). 676 * @param mixed $show Type of information requested. 677 */ 678 $output = apply_filters( 'bloginfo_url', $output, $show ); 679 } else { 680 /** 681 * Filter the site information returned by get_bloginfo(). 682 * 683 * @since 0.71 684 * 685 * @param mixed $output The requested non-URL site information. 686 * @param mixed $show Type of information requested. 687 */ 688 $output = apply_filters( 'bloginfo', $output, $show ); 689 } 536 690 } 537 691 … … 655 809 } 656 810 657 $title = apply_filters('wp_title', $title, $sep, $seplocation); 811 /** 812 * Filter the text of the page title. 813 * 814 * @since 2.0.0 815 * 816 * @param string $title Page title. 817 * @param string $sep Title separator. 818 * @param string $seplocation Location of the separator (left or right). 819 */ 820 $title = apply_filters( 'wp_title', $title, $sep, $seplocation ); 658 821 659 822 // Send it out … … 687 850 return; 688 851 689 $title = apply_filters('single_post_title', $_post->post_title, $_post); 852 /** 853 * Filter the page title for a single post. 854 * 855 * @since 0.71 856 * 857 * @param string $_post_title The single post page title. 858 * @param object $_post The current queried object as returned by get_queried_object(). 859 */ 860 $title = apply_filters( 'single_post_title', $_post->post_title, $_post ); 690 861 if ( $display ) 691 862 echo $prefix . $title; … … 715 886 716 887 $post_type_obj = get_post_type_object( $post_type ); 888 717 889 /** 718 890 * Filter the post type archive title. … … 796 968 return; 797 969 798 if ( is_category() ) 970 if ( is_category() ) { 971 /** 972 * Filter the category archive page title. 973 * 974 * @since 2.0.10 975 * 976 * @param string $term_name Category name for archive being displayed. 977 */ 799 978 $term_name = apply_filters( 'single_cat_title', $term->name ); 800 elseif ( is_tag() ) 979 } elseif ( is_tag() ) { 980 /** 981 * Filter the tag archive page title. 982 * 983 * @since 2.3.0 984 * 985 * @param string $term_name Tag name for archive being displayed. 986 */ 801 987 $term_name = apply_filters( 'single_tag_title', $term->name ); 802 elseif ( is_tax() ) 988 } elseif ( is_tax() ) { 989 /** 990 * Filter the custom taxonomy archive page title. 991 * 992 * @since 3.1.0 993 * 994 * @param string $term_name Term name for archive being displayed. 995 */ 803 996 $term_name = apply_filters( 'single_term_title', $term->name ); 804 else997 } else { 805 998 return; 999 } 806 1000 807 1001 if ( empty( $term_name ) ) … … 903 1097 $link_html = "\t$before<a href='$url'>$text</a>$after\n"; 904 1098 1099 /** 1100 * Filter the archive link content. 1101 * 1102 * @since 2.6.0 1103 * 1104 * @param string $link_html The archive HTML link content. 1105 */ 905 1106 $link_html = apply_filters( 'get_archives_link', $link_html ); 906 1107 … … 979 1180 } 980 1181 1182 /** 1183 * Filter the SQL WHERE clause for retrieving archives. 1184 * 1185 * @since 2.2.0 1186 * 1187 * @param string $sql_where Portion of SQL query containing the WHERE clause. 1188 * @param array $r An array of default arguments. 1189 */ 981 1190 $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r ); 1191 1192 /** 1193 * Filter the SQL JOIN clause for retrieving archives. 1194 * 1195 * @since 2.2.0 1196 * 1197 * @param string $sql_join Portion of SQL query containing JOIN clause. 1198 * @param array $r An array of default arguments. 1199 */ 982 1200 $join = apply_filters( 'getarchives_join', '', $r ); 983 1201 … … 1138 1356 if ( is_array($cache) && isset( $cache[ $key ] ) ) { 1139 1357 if ( $echo ) { 1140 echo apply_filters( 'get_calendar', $cache[$key] ); 1358 /** This filter is documented in wp-includes/general-template.php */ 1359 echo apply_filters( 'get_calendar', $cache[$key] ); 1141 1360 return; 1142 1361 } else { 1143 return apply_filters( 'get_calendar', $cache[$key] ); 1362 /** This filter is documented in wp-includes/general-template.php */ 1363 return apply_filters( 'get_calendar', $cache[$key] ); 1144 1364 } 1145 1365 } … … 1324 1544 wp_cache_set( 'get_calendar', $cache, 'calendar' ); 1325 1545 1326 if ( $echo ) 1327 echo apply_filters( 'get_calendar', $calendar_output ); 1328 else 1329 return apply_filters( 'get_calendar', $calendar_output ); 1546 if ( $echo ) { 1547 /** 1548 * Filter the HTML calendar output. 1549 * 1550 * @since 3.0.0 1551 * 1552 * @param string $calendar_output HTML output of the calendar. 1553 */ 1554 echo apply_filters( 'get_calendar', $calendar_output ); 1555 } else { 1556 /** This filter is documented in wp-includes/general-template.php */ 1557 return apply_filters( 'get_calendar', $calendar_output ); 1558 } 1330 1559 1331 1560 } … … 1395 1624 * 1396 1625 * @since 0.71 1626 * 1397 1627 * @uses get_the_date() 1398 1628 * @param string $d Optional. PHP date format defaults to the date_format option if not specified. … … 1409 1639 $previousday = $currentday; 1410 1640 1641 /** 1642 * Filter the date a post was published for display. 1643 * 1644 * @since 0.71 1645 * 1646 * @param string $the_date The formatted date string. 1647 * @param string $d PHP date format. Defaults to 'date_format' option 1648 * if not specified. 1649 * @param string $before HTML output before the date. 1650 * @param string $after HTML output after the date. 1651 */ 1411 1652 $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after ); 1412 1653 … … 1442 1683 1443 1684 /** 1444 * Filter the date returned from the get_the_date function.1685 * Filter the date a post was published. 1445 1686 * 1446 1687 * @since 3.0.0 1447 1688 * 1448 1689 * @param string $the_date The formatted date. 1449 * @param string $d The date format. 1450 * @param int|WP_Post $post The post object or id. 1690 * @param string $d PHP date format. Defaults to 'date_format' option 1691 * if not specified. 1692 * @param int|WP_Post $post The post object or ID. 1451 1693 */ 1452 1694 return apply_filters( 'get_the_date', $the_date, $d, $post ); … … 1467 1709 1468 1710 $the_modified_date = $before . get_the_modified_date($d) . $after; 1469 $the_modified_date = apply_filters('the_modified_date', $the_modified_date, $d, $before, $after); 1711 1712 /** 1713 * Filter the date a post was last modified for display. 1714 * 1715 * @since 2.1.0 1716 * 1717 * @param string $the_modified_date The last modified date. 1718 * @param string $d PHP date format. Defaults to 'date_format' option 1719 * if not specified. 1720 * @param string $before HTML output before the date. 1721 * @param string $after HTML output after the date. 1722 */ 1723 $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after ); 1470 1724 1471 1725 if ( $echo ) … … 1489 1743 else 1490 1744 $the_time = get_post_modified_time($d, null, null, true); 1491 return apply_filters('get_the_modified_date', $the_time, $d); 1745 1746 /** 1747 * Filter the date a post was last modified. 1748 * 1749 * @since 2.1.0 1750 * 1751 * @param string $the_time The formatted date. 1752 * @param string $d PHP date format. Defaults to value specified in 1753 * 'date_format' option. 1754 */ 1755 return apply_filters( 'get_the_modified_date', $the_time, $d ); 1492 1756 } 1493 1757 … … 1500 1764 */ 1501 1765 function the_time( $d = '' ) { 1502 echo apply_filters('the_time', get_the_time( $d ), $d); 1766 /** 1767 * Filter the time a post was written for display. 1768 * 1769 * @since 0.71 1770 * 1771 * @param string $get_the_time The formatted time. 1772 * @param string $d The time format. Accepts 'G', 'U', 1773 * or php date format. 1774 */ 1775 echo apply_filters( 'the_time', get_the_time( $d ), $d ); 1503 1776 } 1504 1777 … … 1521 1794 else 1522 1795 $the_time = get_post_time($d, false, $post, true); 1523 return apply_filters('get_the_time', $the_time, $d, $post); 1796 1797 /** 1798 * Filter the time a post was written. 1799 * 1800 * @since 1.5.0 1801 * 1802 * @param string $the_time The formatted time. 1803 * @param string $d Format to use for retrieving the time the post was written. 1804 * Accepts 'G', 'U', or php date format value specified 1805 * in 'time_format' option. Default empty. 1806 * @param int|WP_Post $post WP_Post object or ID. 1807 */ 1808 return apply_filters( 'get_the_time', $the_time, $d, $post ); 1524 1809 } 1525 1810 … … 1545 1830 1546 1831 $time = mysql2date($d, $time, $translate); 1547 return apply_filters('get_post_time', $time, $d, $gmt); 1832 1833 /** 1834 * Filter the localized time a post was written. 1835 * 1836 * @since 2.6.0 1837 * 1838 * @param string $time The formatted time. 1839 * @param string $d Format to use for retrieving the time the post was written. 1840 * Accepts 'G', 'U', or php date format. Default 'U'. 1841 * @param bool $gmt Whether to retrieve the GMT time. Default false. 1842 */ 1843 return apply_filters( 'get_post_time', $time, $d, $gmt ); 1548 1844 } 1549 1845 … … 1556 1852 */ 1557 1853 function the_modified_time($d = '') { 1558 echo apply_filters('the_modified_time', get_the_modified_time($d), $d); 1854 /** 1855 * Filter the localized time a post was last modified, for display. 1856 * 1857 * @since 2.0.0 1858 * 1859 * @param string $get_the_modified_time The formatted time. 1860 * @param string $d The time format. Accepts 'G', 'U', 1861 * or php date format. Defaults to value 1862 * specified in 'time_format' option. 1863 */ 1864 echo apply_filters( 'the_modified_time', get_the_modified_time($d), $d ); 1559 1865 } 1560 1866 … … 1572 1878 else 1573 1879 $the_time = get_post_modified_time($d, null, null, true); 1574 return apply_filters('get_the_modified_time', $the_time, $d); 1880 1881 /** 1882 * Filter the localized time a post was last modified. 1883 * 1884 * @since 2.0.0 1885 * 1886 * @param string $the_time The formatted time. 1887 * @param string $d Format to use for retrieving the time the post was 1888 * written. Accepts 'G', 'U', or php date format. Defaults 1889 * to value specified in 'time_format' option. 1890 */ 1891 return apply_filters( 'get_the_modified_time', $the_time, $d ); 1575 1892 } 1576 1893 … … 1595 1912 $time = mysql2date($d, $time, $translate); 1596 1913 1597 return apply_filters('get_post_modified_time', $time, $d, $gmt); 1914 /** 1915 * Filter the localized time a post was last modified. 1916 * 1917 * @since 2.8.0 1918 * 1919 * @param string $time The formatted time. 1920 * @param string $d The date format. Accepts 'G', 'U', or php date format. Default 'U'. 1921 * @param bool $gmt Whether to return the GMT time. Default false. 1922 */ 1923 return apply_filters( 'get_post_modified_time', $time, $d, $gmt ); 1598 1924 } 1599 1925 … … 1608 1934 global $wp_locale; 1609 1935 $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) ); 1610 $the_weekday = apply_filters('the_weekday', $the_weekday); 1936 1937 /** 1938 * Filter the weekday on which the post was written, for display. 1939 * 1940 * @since 0.71 1941 * 1942 * @param string $the_weekday 1943 */ 1944 $the_weekday = apply_filters( 'the_weekday', $the_weekday ); 1611 1945 echo $the_weekday; 1612 1946 } … … 1632 1966 $previousweekday = $currentday; 1633 1967 } 1634 $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after); 1968 1969 /** 1970 * Filter the localized date on which the post was written, for display. 1971 * 1972 * @since 0.71 1973 * 1974 * @param string $the_weekday_date 1975 * @param string $before The HTML to output before the date. 1976 * @param string $after The HTML to output after the date. 1977 */ 1978 $the_weekday_date = apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after ); 1635 1979 echo $the_weekday_date; 1636 1980 } … … 1640 1984 * 1641 1985 * @since 1.2.0 1642 * @uses do_action() Calls 'wp_head' hook.1643 1986 */ 1644 1987 function wp_head() { 1645 do_action('wp_head'); 1988 /** 1989 * Print scripts or data in the head tag on the front end. 1990 * 1991 * @since 1.5.0 1992 */ 1993 do_action( 'wp_head' ); 1646 1994 } 1647 1995 … … 1650 1998 * 1651 1999 * @since 1.5.1 1652 * @uses do_action() Calls 'wp_footer' hook.1653 2000 */ 1654 2001 function wp_footer() { 1655 do_action('wp_footer'); 2002 /** 2003 * Print scripts or data before the closing body tag on the front end. 2004 * 2005 * @since 1.5.1 2006 */ 2007 do_action( 'wp_footer' ); 1656 2008 } 1657 2009 … … 1833 2185 } 1834 2186 1835 return apply_filters('user_can_richedit', $wp_rich_edit); 2187 /** 2188 * Filter whether the user can access the rich (Visual) editor. 2189 * 2190 * @since 2.1.0 2191 * 2192 * @param bool $wp_rich_edit Whether the user can access to the rich (Visual) editor. 2193 */ 2194 return apply_filters( 'user_can_richedit', $wp_rich_edit ); 1836 2195 } 1837 2196 … … 1852 2211 $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r; 1853 2212 } 1854 return apply_filters( 'wp_default_editor', $r ); // filter 2213 2214 /** 2215 * Filter which editor should be displayed by default. 2216 * 2217 * @since 2.5.0 2218 * 2219 * @param array $r An array of editors. Accepts 'tinymce', 'html', 'test'. 2220 */ 2221 return apply_filters( 'wp_default_editor', $r ); 1855 2222 } 1856 2223 … … 1895 2262 */ 1896 2263 function get_search_query( $escaped = true ) { 2264 /** 2265 * Filter the contents of the search query variable. 2266 * 2267 * @since 2.3.0 2268 * 2269 * @param mixed $search Contents of the search query variable. 2270 */ 1897 2271 $query = apply_filters( 'get_search_query', get_query_var( 's' ) ); 2272 1898 2273 if ( $escaped ) 1899 2274 $query = esc_attr( $query ); … … 1911 2286 */ 1912 2287 function the_search_query() { 2288 /** 2289 * Filter the contents of the search query variable for display. 2290 * 2291 * @since 2.3.0 2292 * 2293 * @param mixed $search Contents of the search query variable. 2294 */ 1913 2295 echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) ); 1914 2296 } … … 1940 2322 1941 2323 $output = implode(' ', $attributes); 1942 $output = apply_filters('language_attributes', $output); 1943 echo $output; 2324 2325 /** 2326 * Filter the language attributes for display in the html tag. 2327 * 2328 * @since 2.5.0 2329 * 2330 * @param string $output A space-separated list of language attributes. 2331 */ 2332 echo apply_filters( 'language_attributes', $output ); 1944 2333 } 1945 2334 … … 2036 2425 $link = add_query_arg( $add_args, $link ); 2037 2426 $link .= $add_fragment; 2427 2428 /** 2429 * Filter the paginated links for the given archive pages. 2430 * 2431 * @since 3.0.0 2432 * 2433 * @param string $link The paginated link URL. 2434 */ 2038 2435 $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>'; 2039 2436 endif; … … 2049 2446 $link = add_query_arg( $add_args, $link ); 2050 2447 $link .= $add_fragment; 2448 2449 /** This filter is documented in wp-includes/general-template.php */ 2051 2450 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $before_page_number . number_format_i18n( $n ) . $after_page_number . "</a>"; 2052 2451 $dots = true; … … 2063 2462 $link = add_query_arg( $add_args, $link ); 2064 2463 $link .= $add_fragment; 2464 2465 /** This filter is documented in wp-includes/general-template.php */ 2065 2466 $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>'; 2066 2467 endif; … … 2192 2593 $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file ); 2193 2594 2595 /** 2596 * Filter the URI of a WordPress admin CSS file. 2597 * 2598 * @since 2.3.0 2599 * 2600 * @param string $_file Relative path to the file with query arguments attached. 2601 * @param string $file Relative path to the file, minus its ".css" extension. 2602 */ 2194 2603 return apply_filters( 'wp_admin_css_uri', $_file, $file ); 2195 2604 } … … 2232 2641 } 2233 2642 2643 /** 2644 * Filter the stylesheet link to the specified CSS file. 2645 * 2646 * If the site is set to display right-to-left, the RTL stylesheet link 2647 * will be used instead. 2648 * 2649 * @since 2.3.0 2650 * 2651 * @param string $file Style handle name or filename (without ".css" extension) 2652 * relative to wp-admin/. Defaults to 'wp-admin'. 2653 */ 2234 2654 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file ); 2235 if ( function_exists( 'is_rtl' ) && is_rtl() ) 2655 2656 if ( function_exists( 'is_rtl' ) && is_rtl() ) { 2657 /** This filter is documented in wp-includes/general-template.php */ 2236 2658 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" ); 2659 } 2237 2660 } 2238 2661 … … 2260 2683 */ 2261 2684 function wp_generator() { 2685 /** 2686 * Filter the output of the XHTML generator tag. 2687 * 2688 * @since 2.5.0 2689 * 2690 * @param string $generator_type The XHTML generator. 2691 */ 2262 2692 the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); 2263 2693 } … … 2270 2700 * 2271 2701 * @since 2.5.0 2272 * @uses apply_filters() Calls 'the_generator' hook.2273 2702 * 2274 2703 * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export). 2275 2704 */ 2276 2705 function the_generator( $type ) { 2277 echo apply_filters('the_generator', get_the_generator($type), $type) . "\n"; 2706 /** 2707 * Filter the output of the XHTML generator tag for display. 2708 * 2709 * @since 2.5.0 2710 * 2711 * @param string $generator_type The generator output. 2712 * @param string $type The type of generator to output. Accepts 'html', 2713 * 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'. 2714 */ 2715 echo apply_filters( 'the_generator', get_the_generator($type), $type ) . "\n"; 2278 2716 } 2279 2717 … … 2286 2724 * 2287 2725 * @since 2.5.0 2288 * @uses apply_filters() Calls 'get_the_generator_$type' hook.2289 2726 * 2290 2727 * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export). … … 2341 2778 break; 2342 2779 } 2780 2781 /** 2782 * Filter the HTML for the retrieved generator type. 2783 * 2784 * The dynamic portion of the hook name, $type, refers to the generator type. 2785 * 2786 * @since 2.5.0 2787 * 2788 * @param string $gen The HTML markup output to 'wp_head()'. 2789 * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom', 2790 * 'rss2', 'rdf', 'comment', 'export'. 2791 */ 2343 2792 return apply_filters( "get_the_generator_{$type}", $gen, $type ); 2344 2793 }
Note: See TracChangeset
for help on using the changeset viewer.