Ticket #27719: 27719.4.diff
| File 27719.4.diff, 26.1 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/general-template.php
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 27 39 $templates = array(); … … 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 57 81 $templates = array(); … … 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 87 123 $templates = array(); … … 120 156 * @param string $name The name of the specialised template. 121 157 */ 122 158 function get_template_part( $slug, $name = null ) { 159 /** 160 * Fires before the specified template file is loaded. 161 * 162 * The dynamic portion of the hook name, $slug, refers to the slug name 163 * for the generic template. 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 125 172 $templates = array(); … … 157 204 * @return string|null String when retrieving, null when displaying or if searchform.php exists. 158 205 */ 159 206 function get_search_form( $echo = true ) { 207 /** 208 * Fires before displaying the search form. 209 * 210 * @since 2.7.0 Formerly 'get_search_form' action. 211 * @since 3.6.0 212 * 213 * @link https://core.trac.wordpress.org/ticket/19321 214 */ 160 215 do_action( 'pre_get_search_form' ); 161 216 162 217 $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml'; 218 219 /** 220 * Filter the HTML format of the search form. 221 * 222 * @since 3.6.0 223 * 224 * @param string $format The type of markup to use in the search form. 225 * Accepts 'html5', 'xhtml'. 226 */ 163 227 $format = apply_filters( 'search_form_format', $format ); 164 228 165 229 $search_form_template = locate_template( 'searchform.php' ); … … 187 251 } 188 252 } 189 253 254 /** 255 * Filter the HTML output of the search form. 256 * 257 * @since 2.7.0 258 * 259 * @param string $form The search form HTML output. 260 */ 190 261 $result = apply_filters( 'get_search_form', $form ); 191 262 if ( null === $result ) 192 263 $result = $form; … … 216 287 else 217 288 $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>'; 218 289 219 if ( $echo ) 220 echo apply_filters('loginout', $link); 221 else 222 return apply_filters('loginout', $link); 290 if ( $echo ) { 291 /** 292 * Filter the HTML output for the Log In/Log Out link. 293 * 294 * @since 1.5.0 295 * 296 * @param string $link The HTML link content. 297 */ 298 echo apply_filters( 'loginout', $link ); 299 } else { 300 /** This filter is documented in wp-includes/general-template.php */ 301 return apply_filters( 'loginout', $link ); 302 } 223 303 } 224 304 225 305 /** … … 244 324 $logout_url = add_query_arg($args, site_url('wp-login.php', 'login')); 245 325 $logout_url = wp_nonce_url( $logout_url, 'log-out' ); 246 326 247 return apply_filters('logout_url', $logout_url, $redirect); 327 /** 328 * Filter the Log Out URL of the site. 329 * 330 * @since 2.8.0 331 * 332 * @param string $logout_url The logout URL. 333 * @param string $redirect The path to redirect to on logout, if supplied. 334 */ 335 return apply_filters( 'logout_url', $logout_url, $redirect ); 248 336 } 249 337 250 338 /** … … 269 357 if ( $force_reauth ) 270 358 $login_url = add_query_arg('reauth', '1', $login_url); 271 359 272 return apply_filters('login_url', $login_url, $redirect); 360 /** 361 * Filter the login URL. 362 * 363 * @since 2.8.0 364 * 365 * @param string $login_url The login URL. 366 * @param string $redirect The path to redirect to on login, if supplied. 367 */ 368 return apply_filters( 'login_url', $login_url, $redirect ); 273 369 } 274 370 275 371 /** … … 284 380 * @return string 285 381 */ 286 382 function wp_registration_url() { 383 /** 384 * Filter the user registration URL. 385 * 386 * @since 3.6.0 387 * 388 * @param string $register The user registration URL. 389 */ 287 390 return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) ); 288 391 } 289 392 … … 312 415 'value_username' => '', 313 416 'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked 314 417 ); 418 419 /** 420 * Filter the default arguments of the login form output. 421 * 422 * @since 3.0.0 423 * 424 * @see wp_login_form() 425 * 426 * @param array $defaults An array of default login form arguments. 427 */ 315 428 $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) ); 316 429 317 430 $form = ' … … 359 472 } 360 473 361 474 $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') ); 475 476 /** 477 * Filter the lost password URL. 478 * 479 * @since 2.8.0 480 * 481 * @param string $lostpassword_url The lost password page URL. 482 * @param string $redirect The path to redirect to on login. 483 */ 362 484 return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect ); 363 485 } 364 486 … … 387 509 $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after; 388 510 } 389 511 390 if ( $echo ) 391 echo apply_filters('register', $link); 392 else 393 return apply_filters('register', $link); 512 if ( $echo ) { 513 /** 514 * Filter the HTML link to the Registration or Admin page. 515 * 516 * @since 1.5.0 517 * 518 * @param string $link The HTML code for the link to the Registration or Admin page. 519 */ 520 echo apply_filters( 'register', $link ); 521 } else { 522 /** This filter is documented in wp-includes/general-template.php */ 523 return apply_filters( 'register', $link ); 524 } 394 525 } 395 526 396 527 /** … … 404 535 * @uses do_action() Calls 'wp_meta' hook. 405 536 */ 406 537 function wp_meta() { 407 do_action('wp_meta'); 538 /** 539 * Fires before displaying echoed content in the sidebar. 540 * 541 * @since 1.5.0 542 */ 543 do_action( 'wp_meta' ); 408 544 } 409 545 410 546 /** … … 529 665 $url = false; 530 666 531 667 if ( 'display' == $filter ) { 532 if ( $url ) 533 $output = apply_filters('bloginfo_url', $output, $show); 534 else 535 $output = apply_filters('bloginfo', $output, $show); 668 if ( $url ) { 669 /** 670 * Filter the URL returned by get_bloginfo(). 671 * 672 * @since 2.0.5 673 * 674 * @param string $output The URL returned by bloginfo(). 675 * @param string $show The blog information requested. 676 */ 677 $output = apply_filters( 'bloginfo_url', $output, $show ); 678 } else { 679 /** 680 * Filter the blog information returned by get_bloginfo(). 681 * 682 * @since 0.71 683 * 684 * @param string $output The non-URL information mentioned in $show. 685 * @param string $show The blog information requested. 686 */ 687 $output = apply_filters( 'bloginfo', $output, $show ); 688 } 536 689 } 537 690 538 691 return $output; … … 654 807 $title = $prefix . implode( " $sep ", $title_array ); 655 808 } 656 809 657 $title = apply_filters('wp_title', $title, $sep, $seplocation); 810 /** 811 * Filter the text to be displayed between the title tags. 812 * 813 * @since 2.0.0 814 * 815 * @param string $title The page title. 816 * @param string $sep The title separator. 817 * @param string $seplocation The location of the separator (left or right). 818 */ 819 $title = apply_filters( 'wp_title', $title, $sep, $seplocation ); 658 820 659 821 // Send it out 660 822 if ( $display ) … … 686 848 if ( !isset($_post->post_title) ) 687 849 return; 688 850 689 $title = apply_filters('single_post_title', $_post->post_title, $_post); 851 /** 852 * Filter the single post page title. 853 * 854 * @since 0.71 855 * 856 * @param string $_post_title The single post page title. 857 * @param object $_post The current queried object as returned by get_queried_object(). 858 */ 859 $title = apply_filters( 'single_post_title', $_post->post_title, $_post ); 690 860 if ( $display ) 691 861 echo $prefix . $title; 692 862 else … … 714 884 $post_type = reset( $post_type ); 715 885 716 886 $post_type_obj = get_post_type_object( $post_type ); 887 717 888 /** 718 889 * Filter the post type archive title. 719 890 * … … 795 966 if ( !$term ) 796 967 return; 797 968 798 if ( is_category() ) 969 if ( is_category() ) { 970 /** 971 * Filter the page title for the category archive. 972 * 973 * @since 2.0.10 974 * 975 * @param string $term_name Category name for archive being displayed. 976 */ 799 977 $term_name = apply_filters( 'single_cat_title', $term->name ); 800 elseif ( is_tag() ) 978 } elseif ( is_tag() ) { 979 /** 980 * Filter the page title for the tag archive. 981 * 982 * @since 2.3.0 983 * 984 * @param string $term_name Tag name for archive being displayed. 985 */ 801 986 $term_name = apply_filters( 'single_tag_title', $term->name ); 802 elseif ( is_tax() ) 987 } elseif ( is_tax() ) { 988 /** 989 * Filter the page title for a custom taxonomy archive page. 990 * 991 * @since 3.1.0 992 * 993 * @param string $term_name Term name for archive being displayed. 994 */ 803 995 $term_name = apply_filters( 'single_term_title', $term->name ); 804 else996 } else 805 997 return; 806 998 807 999 if ( empty( $term_name ) ) … … 902 1094 else // custom 903 1095 $link_html = "\t$before<a href='$url'>$text</a>$after\n"; 904 1096 1097 /** 1098 * Filter the archive HTML link content. 1099 * 1100 * @since 2.6.0 1101 * 1102 * @param string $link_html The archive HTML link content. 1103 */ 905 1104 $link_html = apply_filters( 'get_archives_link', $link_html ); 906 1105 907 1106 return $link_html; … … 978 1177 $archive_week_end_date_format = get_option('date_format'); 979 1178 } 980 1179 1180 /** 1181 * Filter the SQL WHERE clause for retrieving archives. 1182 * 1183 * @since 2.2.0 1184 * 1185 * @param string $sql_where Portion of SQL query containing the WHERE clause. 1186 * @param array $r An array of default arguments. 1187 */ 981 1188 $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r ); 1189 1190 /** 1191 * Filter the SQL JOIN clause for retrieving archives. 1192 * 1193 * @since 2.2.0 1194 * 1195 * @param string $sql_join Portion of SQL query containing JOIN clause. 1196 * @param array $r An array of default arguments. 1197 */ 982 1198 $join = apply_filters( 'getarchives_join', '', $r ); 983 1199 984 1200 $output = ''; … … 1137 1353 if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { 1138 1354 if ( is_array($cache) && isset( $cache[ $key ] ) ) { 1139 1355 if ( $echo ) { 1140 echo apply_filters( 'get_calendar', $cache[$key] ); 1356 /** 1357 * Filter the HTML output of the get_calender function. 1358 * 1359 * @since 3.0.0 1360 * 1361 * @param string $cache_key HTML output of the calendar. 1362 */ 1363 echo apply_filters( 'get_calendar', $cache[$key] ); 1141 1364 return; 1142 1365 } else { 1143 return apply_filters( 'get_calendar', $cache[$key] ); 1366 /** This filter is documented in wp-includes/general-template.php */ 1367 return apply_filters( 'get_calendar', $cache[$key] ); 1144 1368 } 1145 1369 } 1146 1370 } … … 1323 1547 $cache[ $key ] = $calendar_output; 1324 1548 wp_cache_set( 'get_calendar', $cache, 'calendar' ); 1325 1549 1326 if ( $echo ) 1327 echo apply_filters( 'get_calendar', $calendar_output ); 1328 else 1329 return apply_filters( 'get_calendar', $calendar_output ); 1550 if ( $echo ) { 1551 /** This filter is documented in wp-includes/general-template.php */ 1552 echo apply_filters( 'get_calendar', $calendar_output ); 1553 } else { 1554 /** This filter is documented in wp-includes/general-template.php */ 1555 return apply_filters( 'get_calendar', $calendar_output ); 1556 } 1330 1557 1331 1558 } 1332 1559 … … 1408 1635 $the_date = $before . get_the_date( $d ) . $after; 1409 1636 $previousday = $currentday; 1410 1637 1638 /** 1639 * Filter the HTML output for displaying the date. 1640 * 1641 * @since 0.71 1642 * 1643 * @param string $the_date The formatted date string. 1644 * @param string $d PHP date format. Defaults to 'date_format' option 1645 * if not specified. 1646 * @param string $before HTML output before the date. 1647 * @param string $after HTML output after the date. 1648 */ 1411 1649 $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after ); 1412 1650 1413 1651 if ( $echo ) … … 1441 1679 } 1442 1680 1443 1681 /** 1444 * Filter the date returned from the get_the_date function.1682 * Filter the retrieved date a post was written. 1445 1683 * 1446 1684 * @since 3.0.0 1447 1685 * 1448 1686 * @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. 1687 * @param string $d PHP date format. Defaults to 'date_format' option 1688 * if not specified. 1689 * @param int|WP_Post $post The post object or ID. 1451 1690 */ 1452 1691 return apply_filters( 'get_the_date', $the_date, $d, $post ); 1453 1692 } … … 1466 1705 function the_modified_date($d = '', $before='', $after='', $echo = true) { 1467 1706 1468 1707 $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);1470 1708 1709 /** 1710 * Filter the HTML output for displaying the last modified date. 1711 * 1712 * @since 2.1.0 1713 * 1714 * @param string $the_modified_date The last modified date. 1715 * @param string $d PHP date format. Defaults to 'date_format' option 1716 * if not specified. 1717 * @param string $before HTML output before the date. 1718 * @param string $after HTML output after the date. 1719 */ 1720 $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after ); 1721 1471 1722 if ( $echo ) 1472 1723 echo $the_modified_date; 1473 1724 else … … 1488 1739 $the_time = get_post_modified_time(get_option('date_format'), null, null, true); 1489 1740 else 1490 1741 $the_time = get_post_modified_time($d, null, null, true); 1491 return apply_filters('get_the_modified_date', $the_time, $d); 1742 /** 1743 * Filter the retrieved date a post was last modified. 1744 * 1745 * @since 2.1.0 1746 * 1747 * @param string $the_time The formatted date. 1748 * @param string $d PHP date format. Defaults to value specified in 1749 * 'date_format' option. 1750 */ 1751 return apply_filters( 'get_the_modified_date', $the_time, $d ); 1492 1752 } 1493 1753 1494 1754 /** … … 1499 1759 * @param string $d Either 'G', 'U', or php date format. 1500 1760 */ 1501 1761 function the_time( $d = '' ) { 1502 echo apply_filters('the_time', get_the_time( $d ), $d); 1762 /** 1763 * Filter the display of the time a post was written. 1764 * 1765 * @since 0.71 1766 * 1767 * @param string $get_the_time The formatted time. 1768 * @param string $d The time format. Accepts 'G', 'U', 1769 * or php date format. 1770 */ 1771 echo apply_filters( 'the_time', get_the_time( $d ), $d ); 1503 1772 } 1504 1773 1505 1774 /** … … 1520 1789 $the_time = get_post_time(get_option('time_format'), false, $post, true); 1521 1790 else 1522 1791 $the_time = get_post_time($d, false, $post, true); 1523 return apply_filters('get_the_time', $the_time, $d, $post); 1792 /** 1793 * Filter the retrieved time a post was written. 1794 * 1795 * @since 1.5.0 1796 * 1797 * @param string $the_time The formatted time. 1798 * @param string $d Format to use for retrieving the time the post was written. 1799 * Accepts 'G', 'U', or php date format value specified 1800 * in 'time_format' option. Default empty. 1801 * @param int|WP_Post $post WP_Post object or ID. 1802 */ 1803 return apply_filters( 'get_the_time', $the_time, $d, $post ); 1524 1804 } 1525 1805 1526 1806 /** … … 1544 1824 $time = $post->post_date; 1545 1825 1546 1826 $time = mysql2date($d, $time, $translate); 1547 return apply_filters('get_post_time', $time, $d, $gmt); 1827 1828 /** 1829 * Filter the retrieved time a post was written. 1830 * 1831 * @since 2.6.0 1832 * 1833 * @param string $time The formatted time. 1834 * @param string $d Format to use for retrieving the time the post was written. 1835 * Accepts 'G', 'U', or php date format. Default 'U'. 1836 * @param bool $gmt Whether to retrieve the GMT time. Default false. 1837 */ 1838 return apply_filters( 'get_post_time', $time, $d, $gmt ); 1548 1839 } 1549 1840 1550 1841 /** … … 1555 1846 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option. 1556 1847 */ 1557 1848 function the_modified_time($d = '') { 1558 echo apply_filters('the_modified_time', get_the_modified_time($d), $d); 1849 /** 1850 * Filter the display of the time the post was last modified. 1851 * 1852 * @since 2.0.0 1853 * 1854 * @param string $get_the_modified_time The formatted time. 1855 * @param string $d The time format. Accepts 'G', 'U', 1856 * or php date format. Defaults to value 1857 * specified in 'time_format' option. 1858 */ 1859 echo apply_filters( 'the_modified_time', get_the_modified_time($d), $d ); 1559 1860 } 1560 1861 1561 1862 /** … … 1571 1872 $the_time = get_post_modified_time(get_option('time_format'), null, null, true); 1572 1873 else 1573 1874 $the_time = get_post_modified_time($d, null, null, true); 1574 return apply_filters('get_the_modified_time', $the_time, $d); 1875 1876 /** 1877 * Filter the retrieved time a post was last modified. 1878 * 1879 * @since 2.0.0 1880 * 1881 * @param string $the_time The formatted time. 1882 * @param string $d Format to use for retrieving the time the post was 1883 * written. Accepts 'G', 'U', or php date format. Defaults 1884 * to value specified in 'time_format' option. 1885 */ 1886 return apply_filters( 'get_the_modified_time', $the_time, $d ); 1575 1887 } 1576 1888 1577 1889 /** … … 1594 1906 $time = $post->post_modified; 1595 1907 $time = mysql2date($d, $time, $translate); 1596 1908 1597 return apply_filters('get_post_modified_time', $time, $d, $gmt); 1909 /** 1910 * Filter the retrieved time a post was last modified. 1911 * 1912 * @since 2.8.0 1913 * 1914 * @param string $time The formatted time. 1915 * @param string $d The date format. Accepts 'G', 'U', or php date format. Default 'U'. 1916 * @param bool $gmt Whether to return the GMT time. Default false. 1917 */ 1918 return apply_filters( 'get_post_modified_time', $time, $d, $gmt ); 1598 1919 } 1599 1920 1600 1921 /** … … 1607 1928 function the_weekday() { 1608 1929 global $wp_locale; 1609 1930 $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) ); 1610 $the_weekday = apply_filters('the_weekday', $the_weekday); 1931 1932 /** 1933 * Filter the display of the weekday name a post was written. 1934 * 1935 * @since 0.71 1936 * 1937 * @param string $the_weekday 1938 */ 1939 $the_weekday = apply_filters( 'the_weekday', $the_weekday ); 1611 1940 echo $the_weekday; 1612 1941 } 1613 1942 … … 1631 1960 $the_weekday_date .= $after; 1632 1961 $previousweekday = $currentday; 1633 1962 } 1634 $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after); 1963 1964 /** 1965 * Filter the display of the weekday name a post was written. 1966 * 1967 * @since 0.71 1968 * 1969 * @param string $the_weekday_date 1970 * @param string $before The HTML to output before the date. 1971 * @param string $after The HTML to output after the date. 1972 */ 1973 $the_weekday_date = apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after ); 1635 1974 echo $the_weekday_date; 1636 1975 } 1637 1976 … … 1642 1981 * @uses do_action() Calls 'wp_head' hook. 1643 1982 */ 1644 1983 function wp_head() { 1645 do_action('wp_head'); 1984 /** 1985 * Print scripts or data in the head tag on the front end. 1986 * 1987 * @since 1.5.0 1988 */ 1989 do_action( 'wp_head' ); 1646 1990 } 1647 1991 1648 1992 /** … … 1652 1996 * @uses do_action() Calls 'wp_footer' hook. 1653 1997 */ 1654 1998 function wp_footer() { 1655 do_action('wp_footer'); 1999 /** 2000 * Print scripts or data before the closing body tag on the front end. 2001 * 2002 * @since 1.5.1 2003 */ 2004 do_action( 'wp_footer' ); 1656 2005 } 1657 2006 1658 2007 /** … … 1832 2181 } 1833 2182 } 1834 2183 1835 return apply_filters('user_can_richedit', $wp_rich_edit); 2184 /** 2185 * Filter whether the user should have a WYSIWIG editor. 2186 * 2187 * @since 2.1.0 2188 * 2189 * @param bool $wp_rich_edit Whether the user should have a WYSIWIG editor. 2190 */ 2191 return apply_filters( 'user_can_richedit', $wp_rich_edit ); 1836 2192 } 1837 2193 1838 2194 /** … … 1851 2207 $ed = get_user_setting('editor', 'tinymce'); 1852 2208 $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r; 1853 2209 } 1854 return apply_filters( 'wp_default_editor', $r ); // filter 2210 2211 /** 2212 * Filter which editor should be displayed by default. 2213 * 2214 * @since 2.5.0 2215 * 2216 * @param array $r An array of editors. Accepts 'tinymce', 'html', 'test'. 2217 */ 2218 return apply_filters( 'wp_default_editor', $r ); 1855 2219 } 1856 2220 1857 2221 /** … … 1894 2258 * @return string 1895 2259 */ 1896 2260 function get_search_query( $escaped = true ) { 2261 /** 2262 * Filter the retrieved contents of the search WordPress query variable. 2263 * 2264 * @since 2.3.0 2265 * 2266 * @param bool $s Whether the result is escaped. Default true. 2267 */ 1897 2268 $query = apply_filters( 'get_search_query', get_query_var( 's' ) ); 1898 2269 if ( $escaped ) 1899 2270 $query = esc_attr( $query ); … … 1910 2281 * @since 2.1.0 1911 2282 */ 1912 2283 function the_search_query() { 2284 /** 2285 * Filter the display of the contents of the search query variable. 2286 * 2287 * @since 2.3.0 2288 * 2289 * @param bool $safe Whether the result is safe to display. Default false. 2290 */ 1913 2291 echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) ); 1914 2292 } 1915 2293 … … 1939 2317 } 1940 2318 1941 2319 $output = implode(' ', $attributes); 1942 $output = apply_filters('language_attributes', $output); 2320 2321 /** 2322 * Filter the display of the language attributes for the HTML tag. 2323 * 2324 * @since 2.5.0 2325 * 2326 * @param array $output An array of language attributes. Default empty. 2327 */ 2328 $output = apply_filters( 'language_attributes', $output ); 1943 2329 echo $output; 1944 2330 } 1945 2331 … … 2035 2421 if ( $add_args ) 2036 2422 $link = add_query_arg( $add_args, $link ); 2037 2423 $link .= $add_fragment; 2424 2425 /** 2426 * Filter the retrieved paginated links for archive post pages. 2427 * 2428 * @since 3.0.0 2429 * 2430 * @param string $link The paginated link URL. 2431 */ 2038 2432 $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>'; 2039 2433 endif; 2040 2434 for ( $n = 1; $n <= $total; $n++ ) : … … 2048 2442 if ( $add_args ) 2049 2443 $link = add_query_arg( $add_args, $link ); 2050 2444 $link .= $add_fragment; 2445 2446 /** This filter is documented in wp-includes/general-template.php */ 2051 2447 $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 2448 $dots = true; 2053 2449 elseif ( $dots && !$show_all ) : … … 2062 2458 if ( $add_args ) 2063 2459 $link = add_query_arg( $add_args, $link ); 2064 2460 $link .= $add_fragment; 2461 2462 /** This filter is documented in wp-includes/general-template.php */ 2065 2463 $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>'; 2066 2464 endif; 2067 2465 switch ( $type ) : … … 2191 2589 } 2192 2590 $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file ); 2193 2591 2592 /** 2593 * Filter the URI of a WordPress admin CSS file. 2594 * 2595 * @since 2.3.0 2596 * 2597 * @param string $_file 2598 * @param string $file The file, relative to wp-admin/, without its ".css" extension. 2599 */ 2194 2600 return apply_filters( 'wp_admin_css_uri', $_file, $file ); 2195 2601 } 2196 2602 … … 2231 2637 return; 2232 2638 } 2233 2639 2640 /** 2641 * Filter the stylesheet link to the specified CSS file. 2642 * 2643 * @since 2.3.0 2644 * 2645 * @param string $file Style handle name or filename (without ".css" extension) 2646 * relative to wp-admin/. Defaults to 'wp-admin'. 2647 */ 2234 2648 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file ); 2235 2649 if ( function_exists( 'is_rtl' ) && is_rtl() ) 2650 /** This filter is documented in wp-includes/general-template.php */ 2236 2651 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" ); 2237 2652 } 2238 2653 … … 2259 2674 * @since 2.5.0 2260 2675 */ 2261 2676 function wp_generator() { 2677 /** 2678 * Filter the XHTML generator. 2679 * 2680 * @since 2.5.0 2681 * 2682 * @param string $generator_type The XHTML generator. 2683 */ 2262 2684 the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); 2263 2685 } 2264 2686 … … 2274 2696 * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export). 2275 2697 */ 2276 2698 function the_generator( $type ) { 2277 echo apply_filters('the_generator', get_the_generator($type), $type) . "\n"; 2699 /** 2700 * Filter the generator type. 2701 * 2702 * @since 2.5.0 2703 * 2704 * @param string $generator_type The generator. 2705 * @param string $type The type of generator to output. Accepts 'html', 2706 * 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'. 2707 */ 2708 echo apply_filters( 'the_generator', get_the_generator($type), $type ) . "\n"; 2278 2709 } 2279 2710 2280 2711 /** … … 2340 2771 $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->'; 2341 2772 break; 2342 2773 } 2774 2775 /** 2776 * Filter the HTML for the retrieved generator type. 2777 * 2778 * The dynamic portion of the hook name, $type, refers to the generator type. 2779 * 2780 * @since 2.5.0 2781 * 2782 * @param string $gen The HTML markup output to 'wp_head()'. 2783 * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom', 2784 * 'rss2', 'rdf', 'comment', 'export'. 2785 */ 2343 2786 return apply_filters( "get_the_generator_{$type}", $gen, $type ); 2344 2787 } 2345 2788
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)