Make WordPress Core


Ignore:
Timestamp:
04/15/2014 04:00:48 AM (11 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-includes/general-template.php.

Props jesin, kpdesign.
See #27719.

File:
1 edited

Legend:

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

    r27600 r28130  
    1616 * "special".
    1717 *
     18 * @since 1.5.0
     19 *
    1820 * @uses locate_template()
    19  * @since 1.5.0
    20  * @uses do_action() Calls 'get_header' action.
    2121 *
    2222 * @param string $name The name of the specialised header.
    2323 */
    2424function 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     */
    2537    do_action( 'get_header', $name );
    2638
     
    4658 * "special".
    4759 *
     60 * @since 1.5.0
     61 *
    4862 * @uses locate_template()
    49  * @since 1.5.0
    50  * @uses do_action() Calls 'get_footer' action.
    5163 *
    5264 * @param string $name The name of the specialised footer.
    5365 */
    5466function 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     */
    5579    do_action( 'get_footer', $name );
    5680
     
    76100 * "special".
    77101 *
     102 * @since 1.5.0
     103 *
    78104 * @uses locate_template()
    79  * @since 1.5.0
    80  * @uses do_action() Calls 'get_sidebar' action.
    81105 *
    82106 * @param string $name The name of the specialised sidebar.
    83107 */
    84108function 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     */
    85121    do_action( 'get_sidebar', $name );
    86122
     
    113149 * "special".
    114150 *
     151 * @since 3.0.0
     152 *
    115153 * @uses locate_template()
    116  * @since 3.0.0
    117  * @uses do_action() Calls 'get_template_part_{$slug}' action.
    118154 *
    119155 * @param string $slug The slug name for the generic template.
     
    121157 */
    122158function 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     */
    123170    do_action( "get_template_part_{$slug}", $slug, $name );
    124171
     
    151198 *
    152199 * @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.
    155200 *
    156201 * @param boolean $echo Default to echo and not return the form.
     
    158203 */
    159204function 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     */
    160213    do_action( 'pre_get_search_form' );
    161214
    162215    $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     */
    163225    $format = apply_filters( 'search_form_format', $format );
    164226
     
    188250    }
    189251
     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     */
    190259    $result = apply_filters( 'get_search_form', $form );
     260
    191261    if ( null === $result )
    192262        $result = $form;
     
    205275 *
    206276 * @since 1.5.0
    207  * @uses apply_filters() Calls 'loginout' hook on HTML link content.
    208277 *
    209278 * @param string $redirect Optional path to redirect to on login/logout.
     
    217286        $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
    218287
    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    }
    223301}
    224302
     
    229307 *
    230308 * @since 2.7.0
     309 *
    231310 * @uses wp_nonce_url() To protect against CSRF.
    232311 * @uses site_url() To generate the log out URL.
    233  * @uses apply_filters() calls 'logout_url' hook on final logout URL.
    234312 *
    235313 * @param string $redirect Path to redirect to on logout.
     
    245323    $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    246324
    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 );
    248334}
    249335
     
    254340 *
    255341 * @since 2.7.0
     342 *
    256343 * @uses site_url() To generate the log in URL.
    257  * @uses apply_filters() calls 'login_url' hook on final login URL.
    258344 *
    259345 * @param string $redirect Path to redirect to on login.
     
    270356        $login_url = add_query_arg('reauth', '1', $login_url);
    271357
    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 );
    273367}
    274368
     
    279373 *
    280374 * @since 3.6.0
     375 *
    281376 * @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.
    285379 */
    286380function 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     */
    287388    return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
    288389}
     
    293394 *
    294395 * @since 3.0.0
     396 *
    295397 * @param array $args Configuration options to modify the form output.
    296398 * @return string|null String when retrieving, null when displaying.
     
    313415        'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked
    314416    );
     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     */
    315427    $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );
    316428
     
    347459 *
    348460 * @since 2.8.0
     461 *
    349462 * @uses site_url() To generate the lost password URL
    350  * @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url
    351463 *
    352464 * @param string $redirect Path to redirect to on login.
     
    360472
    361473    $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     */
    362483    return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
    363484}
     
    370491 *
    371492 * @since 1.5.0
    372  * @uses apply_filters() Calls 'register' hook on register / admin link content.
    373493 *
    374494 * @param string $before Text to output before the link (defaults to <li>).
     
    388508    }
    389509
    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    }
    394526}
    395527
     
    401533 *
    402534 * @since 1.5.0
     535 *
    403536 * @link http://trac.wordpress.org/ticket/1458 Explanation of 'wp_meta' action.
    404  * @uses do_action() Calls 'wp_meta' hook.
    405537 */
    406538function 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' );
    408545}
    409546
     
    530667
    531668    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        }
    536690    }
    537691
     
    655809    }
    656810
    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 );
    658821
    659822    // Send it out
     
    687850        return;
    688851
    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 );
    690861    if ( $display )
    691862        echo $prefix . $title;
     
    715886
    716887    $post_type_obj = get_post_type_object( $post_type );
     888
    717889    /**
    718890     * Filter the post type archive title.
     
    796968        return;
    797969
    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         */
    799978        $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         */
    801987        $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         */
    803996        $term_name = apply_filters( 'single_term_title', $term->name );
    804     else
     997    } else {
    805998        return;
     999    }
    8061000
    8071001    if ( empty( $term_name ) )
     
    9031097        $link_html = "\t$before<a href='$url'>$text</a>$after\n";
    9041098
     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     */
    9051106    $link_html = apply_filters( 'get_archives_link', $link_html );
    9061107
     
    9791180    }
    9801181
     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     */
    9811190    $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     */
    9821200    $join = apply_filters( 'getarchives_join', '', $r );
    9831201
     
    11381356        if ( is_array($cache) && isset( $cache[ $key ] ) ) {
    11391357            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] );
    11411360                return;
    11421361            } 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] );
    11441364            }
    11451365        }
     
    13241544    wp_cache_set( 'get_calendar', $cache, 'calendar' );
    13251545
    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    }
    13301559
    13311560}
     
    13951624 *
    13961625 * @since 0.71
     1626 *
    13971627 * @uses get_the_date()
    13981628 * @param string $d Optional. PHP date format defaults to the date_format option if not specified.
     
    14091639        $previousday = $currentday;
    14101640
     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         */
    14111652        $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
    14121653
     
    14421683
    14431684    /**
    1444      * Filter the date returned from the get_the_date function.
     1685     * Filter the date a post was published.
    14451686     *
    14461687     * @since 3.0.0
    14471688     *
    14481689     * @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.
    14511693     */
    14521694    return apply_filters( 'get_the_date', $the_date, $d, $post );
     
    14671709
    14681710    $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 );
    14701724
    14711725    if ( $echo )
     
    14891743    else
    14901744        $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 );
    14921756}
    14931757
     
    15001764 */
    15011765function 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 );
    15031776}
    15041777
     
    15211794    else
    15221795        $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 );
    15241809}
    15251810
     
    15451830
    15461831    $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 );
    15481844}
    15491845
     
    15561852 */
    15571853function 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 );
    15591865}
    15601866
     
    15721878    else
    15731879        $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 );
    15751892}
    15761893
     
    15951912    $time = mysql2date($d, $time, $translate);
    15961913
    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 );
    15981924}
    15991925
     
    16081934    global $wp_locale;
    16091935    $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 );
    16111945    echo $the_weekday;
    16121946}
     
    16321966        $previousweekday = $currentday;
    16331967    }
    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 );
    16351979    echo $the_weekday_date;
    16361980}
     
    16401984 *
    16411985 * @since 1.2.0
    1642  * @uses do_action() Calls 'wp_head' hook.
    16431986 */
    16441987function 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' );
    16461994}
    16471995
     
    16501998 *
    16511999 * @since 1.5.1
    1652  * @uses do_action() Calls 'wp_footer' hook.
    16532000 */
    16542001function 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' );
    16562008}
    16572009
     
    18332185    }
    18342186
    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 );
    18362195}
    18372196
     
    18522211        $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r;
    18532212    }
    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 );
    18552222}
    18562223
     
    18952262 */
    18962263function 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     */
    18972271    $query = apply_filters( 'get_search_query', get_query_var( 's' ) );
     2272
    18982273    if ( $escaped )
    18992274        $query = esc_attr( $query );
     
    19112286 */
    19122287function 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     */
    19132295    echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
    19142296}
     
    19402322
    19412323    $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 );
    19442333}
    19452334
     
    20362425            $link = add_query_arg( $add_args, $link );
    20372426        $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         */
    20382435        $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>';
    20392436    endif;
     
    20492446                    $link = add_query_arg( $add_args, $link );
    20502447                $link .= $add_fragment;
     2448
     2449                /** This filter is documented in wp-includes/general-template.php */
    20512450                $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>";
    20522451                $dots = true;
     
    20632462            $link = add_query_arg( $add_args, $link );
    20642463        $link .= $add_fragment;
     2464
     2465        /** This filter is documented in wp-includes/general-template.php */
    20652466        $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>';
    20662467    endif;
     
    21922593    $_file = add_query_arg( 'version', get_bloginfo( 'version' ),  $_file );
    21932594
     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     */
    21942603    return apply_filters( 'wp_admin_css_uri', $_file, $file );
    21952604}
     
    22322641    }
    22332642
     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     */
    22342654    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 */
    22362658        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    }
    22372660}
    22382661
     
    22602683 */
    22612684function 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     */
    22622692    the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );
    22632693}
     
    22702700 *
    22712701 * @since 2.5.0
    2272  * @uses apply_filters() Calls 'the_generator' hook.
    22732702 *
    22742703 * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).
    22752704 */
    22762705function 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";
    22782716}
    22792717
     
    22862724 *
    22872725 * @since 2.5.0
    2288  * @uses apply_filters() Calls 'get_the_generator_$type' hook.
    22892726 *
    22902727 * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
     
    23412778            break;
    23422779    }
     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     */
    23432792    return apply_filters( "get_the_generator_{$type}", $gen, $type );
    23442793}
Note: See TracChangeset for help on using the changeset viewer.