Make WordPress Core

Ticket #27719: 27719.5.diff

File 27719.5.diff, 30.9 KB (added by DrewAPicture, 12 years ago)

Merged all the patches.

  • src/wp-includes/general-template.php

     
    1515 * For the parameter, if the file is called "header-special.php" then specify
    1616 * "special".
    1717 *
    18  * @uses locate_template()
    1918 * @since 1.5.0
    20  * @uses do_action() Calls 'get_header' action.
    2119 *
     20 * @uses locate_template()
     21 *
    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
    2739        $templates = array();
     
    4557 * For the parameter, if the file is called "footer-special.php" then specify
    4658 * "special".
    4759 *
    48  * @uses locate_template()
    4960 * @since 1.5.0
    50  * @uses do_action() Calls 'get_footer' action.
    5161 *
     62 * @uses locate_template()
     63 *
    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
    5781        $templates = array();
     
    7599 * For the parameter, if the file is called "sidebar-special.php" then specify
    76100 * "special".
    77101 *
    78  * @uses locate_template()
    79102 * @since 1.5.0
    80  * @uses do_action() Calls 'get_sidebar' action.
    81103 *
     104 * @uses locate_template()
     105 *
    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
    87123        $templates = array();
     
    112148 * For the $name parameter, if the file is called "{slug}-special.php" then specify
    113149 * "special".
    114150 *
    115  * @uses locate_template()
    116151 * @since 3.0.0
    117  * @uses do_action() Calls 'get_template_part_{$slug}' action.
    118152 *
     153 * @uses locate_template()
     154 *
    119155 * @param string $slug The slug name for the generic template.
    120156 * @param string $name The name of the specialised 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
    125172        $templates = array();
     
    150197 * search. To give a few examples of what it can be used for.
    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.
    157202 * @return string|null String when retrieving, null when displaying or if searchform.php exists.
    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
    165227        $search_form_template = locate_template( 'searchform.php' );
     
    187249                }
    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;
    193263
     
    204274 * or log out depending on whether they are currently logged in.
    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.
    210279 * @param boolean $echo Default to echo and not return the link.
     
    216285        else
    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
    225303/**
     
    228306 * Returns the URL that allows the user to log out of the site.
    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.
    236314 * @return string A log out URL.
     
    244322        $logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
    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
    250336/**
     
    253339 * Returns the URL that allows the user to log in to the site.
    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.
    260346 * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
     
    269355        if ( $force_reauth )
    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
    275369/**
     
    278372 * Returns the URL that allows the user to register on the site.
    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.
    283377 *
    284  * @return string
     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}
    289390
     
    292393 * the HTML immediately. Pass array('echo'=>false) to return the string instead.
    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.
    297399 */
     
    312414                'value_username' => '',
    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
    317429        $form = '
     
    346458 * Returns the URL that allows the user to retrieve the lost password
    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.
    353465 * @return string Lost password URL.
     
    359471        }
    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}
    364485
     
    369490 * not logged in and registration is enabled or to the dashboard if logged in.
    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>).
    375495 * @param string $after Text to output after the link (defaults to </li>).
     
    387507                $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
    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
    396528/**
     
    400532 * but one purpose might have been to allow for theme switching.
    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
    410547/**
     
    529666                $url = false;
    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
    538692        return $output;
     
    654808                $title = $prefix . implode( " $sep ", $title_array );
    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
    660823        if ( $display )
     
    686849        if ( !isset($_post->post_title) )
    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;
    692863        else
     
    714885                $post_type = reset( $post_type );
    715886
    716887        $post_type_obj = get_post_type_object( $post_type );
     888
    717889        /**
    718890         * Filter the post type archive title.
    719891         *
     
    795967        if ( !$term )
    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;
    806999
    8071000        if ( empty( $term_name ) )
     
    9021095        else // custom
    9031096                $link_html = "\t$before<a href='$url'>$text</a>$after\n";
    9041097
     1098        /**
     1099         * Filter the archive link content.
     1100         *
     1101         * @since 2.6.0
     1102         *
     1103         * @param string $link_html The archive HTML link content.
     1104         */
    9051105        $link_html = apply_filters( 'get_archives_link', $link_html );
    9061106
    9071107        return $link_html;
     
    9781178                $archive_week_end_date_format = get_option('date_format');
    9791179        }
    9801180
     1181        /**
     1182         * Filter the SQL WHERE clause for retrieving archives.
     1183         *
     1184         * @since 2.2.0
     1185         *
     1186         * @param string $sql_where Portion of SQL query containing the WHERE clause.
     1187         * @param array  $r         An array of default arguments.
     1188         */
    9811189        $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
     1190
     1191        /**
     1192         * Filter the SQL JOIN clause for retrieving archives.
     1193         *
     1194         * @since 2.2.0
     1195         *
     1196         * @param string $sql_join Portion of SQL query containing JOIN clause.
     1197         * @param array  $r        An array of default arguments.
     1198         */
    9821199        $join = apply_filters( 'getarchives_join', '', $r );
    9831200
    9841201        $output = '';
     
    11371354        if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
    11381355                if ( is_array($cache) && isset( $cache[ $key ] ) ) {
    11391356                        if ( $echo ) {
    1140                                 echo apply_filters( 'get_calendar',  $cache[$key] );
     1357                                /** This filter is documented in wp-includes/general-template.php */
     1358                                echo apply_filters( 'get_calendar', $cache[$key] );
    11411359                                return;
    11421360                        } else {
    1143                                 return apply_filters( 'get_calendar',  $cache[$key] );
     1361                                /** This filter is documented in wp-includes/general-template.php */
     1362                                return apply_filters( 'get_calendar', $cache[$key] );
    11441363                        }
    11451364                }
    11461365        }
     
    13231542        $cache[ $key ] = $calendar_output;
    13241543        wp_cache_set( 'get_calendar', $cache, 'calendar' );
    13251544
    1326         if ( $echo )
    1327                 echo apply_filters( 'get_calendar',  $calendar_output );
    1328         else
    1329                 return apply_filters( 'get_calendar',  $calendar_output );
     1545        if ( $echo ) {
     1546                /**
     1547                 * Filter the HTML calendar output.
     1548                 *
     1549                 * @since 3.0.0
     1550                 *
     1551                 * @param string $calendar_output HTML output of the calendar.
     1552                 */
     1553                echo apply_filters( 'get_calendar', $calendar_output );
     1554        } else {
     1555                /** This filter is documented in wp-includes/general-template.php */
     1556                return apply_filters( 'get_calendar', $calendar_output );
     1557        }
    13301558
    13311559}
    13321560
     
    13941622 * Date string output can be filtered with 'get_the_date'.
    13951623 *
    13961624 * @since 0.71
     1625 *
    13971626 * @uses get_the_date()
    13981627 * @param string $d Optional. PHP date format defaults to the date_format option if not specified.
    13991628 * @param string $before Optional. Output before the date.
     
    14081637                $the_date = $before . get_the_date( $d ) . $after;
    14091638                $previousday = $currentday;
    14101639
     1640                /**
     1641                 * Filter the date a post was published for display.
     1642                 *
     1643                 * @since 0.71
     1644                 *
     1645                 * @param string $the_date The formatted date string.
     1646                 * @param string $d        PHP date format. Defaults to 'date_format' option
     1647                 *                         if not specified.
     1648                 * @param string $before   HTML output before the date.
     1649                 * @param string $after    HTML output after the date.
     1650                 */
    14111651                $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
    14121652
    14131653                if ( $echo )
     
    14411681        }
    14421682
    14431683        /**
    1444          * Filter the date returned from the get_the_date function.
     1684         * Filter the date a post was published.
    14451685         *
    14461686         * @since 3.0.0
    14471687         *
    14481688         * @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.
     1689         * @param string      $d        PHP date format. Defaults to 'date_format' option
     1690         *                              if not specified.
     1691         * @param int|WP_Post $post     The post object or ID.
    14511692         */
    14521693        return apply_filters( 'get_the_date', $the_date, $d, $post );
    14531694}
     
    14661707function the_modified_date($d = '', $before='', $after='', $echo = true) {
    14671708
    14681709        $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);
    14701710
     1711        /**
     1712         * Filter the date a post was last modified for display.
     1713         *
     1714         * @since 2.1.0
     1715         *
     1716         * @param string $the_modified_date The last modified date.
     1717         * @param string $d                 PHP date format. Defaults to 'date_format' option
     1718         *                                  if not specified.
     1719         * @param string $before            HTML output before the date.
     1720         * @param string $after             HTML output after the date.
     1721         */
     1722        $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after );
     1723
    14711724        if ( $echo )
    14721725                echo $the_modified_date;
    14731726        else
     
    14881741                $the_time = get_post_modified_time(get_option('date_format'), null, null, true);
    14891742        else
    14901743                $the_time = get_post_modified_time($d, null, null, true);
    1491         return apply_filters('get_the_modified_date', $the_time, $d);
     1744
     1745        /**
     1746         * Filter the date a post was last modified.
     1747         *
     1748         * @since 2.1.0
     1749         *
     1750         * @param string $the_time The formatted date.
     1751         * @param string $d        PHP date format. Defaults to value specified in
     1752         *                         'date_format' option.
     1753         */
     1754        return apply_filters( 'get_the_modified_date', $the_time, $d );
    14921755}
    14931756
    14941757/**
     
    14991762 * @param string $d Either 'G', 'U', or php date format.
    15001763 */
    15011764function the_time( $d = '' ) {
    1502         echo apply_filters('the_time', get_the_time( $d ), $d);
     1765        /**
     1766         * Filter the time a post was written for display.
     1767         *
     1768         * @since 0.71
     1769         *
     1770         * @param string $get_the_time The formatted time.
     1771         * @param string $d            The time format. Accepts 'G', 'U',
     1772         *                             or php date format.
     1773         */
     1774        echo apply_filters( 'the_time', get_the_time( $d ), $d );
    15031775}
    15041776
    15051777/**
     
    15201792                $the_time = get_post_time(get_option('time_format'), false, $post, true);
    15211793        else
    15221794                $the_time = get_post_time($d, false, $post, true);
    1523         return apply_filters('get_the_time', $the_time, $d, $post);
     1795
     1796        /**
     1797         * Filter the time a post was written.
     1798         *
     1799         * @since 1.5.0
     1800         *
     1801         * @param string      $the_time The formatted time.
     1802         * @param string      $d        Format to use for retrieving the time the post was written.
     1803         *                              Accepts 'G', 'U', or php date format value specified
     1804         *                              in 'time_format' option. Default empty.
     1805         * @param int|WP_Post $post     WP_Post object or ID.
     1806         */
     1807        return apply_filters( 'get_the_time', $the_time, $d, $post );
    15241808}
    15251809
    15261810/**
     
    15441828                $time = $post->post_date;
    15451829
    15461830        $time = mysql2date($d, $time, $translate);
    1547         return apply_filters('get_post_time', $time, $d, $gmt);
     1831
     1832        /**
     1833         * Filter the localized time a post was written.
     1834         *
     1835         * @since 2.6.0
     1836         *
     1837         * @param string $time The formatted time.
     1838         * @param string $d    Format to use for retrieving the time the post was written.
     1839         *                     Accepts 'G', 'U', or php date format. Default 'U'.
     1840         * @param bool   $gmt  Whether to retrieve the GMT time. Default false.
     1841         */
     1842        return apply_filters( 'get_post_time', $time, $d, $gmt );
    15481843}
    15491844
    15501845/**
     
    15551850 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
    15561851 */
    15571852function the_modified_time($d = '') {
    1558         echo apply_filters('the_modified_time', get_the_modified_time($d), $d);
     1853        /**
     1854         * Filter the localized time a post was last modified, for display.
     1855         *
     1856         * @since 2.0.0
     1857         *
     1858         * @param string $get_the_modified_time The formatted time.
     1859         * @param string $d                     The time format. Accepts 'G', 'U',
     1860         *                                      or php date format. Defaults to value
     1861         *                                      specified in 'time_format' option.
     1862         */
     1863        echo apply_filters( 'the_modified_time', get_the_modified_time($d), $d );
    15591864}
    15601865
    15611866/**
     
    15711876                $the_time = get_post_modified_time(get_option('time_format'), null, null, true);
    15721877        else
    15731878                $the_time = get_post_modified_time($d, null, null, true);
    1574         return apply_filters('get_the_modified_time', $the_time, $d);
     1879
     1880        /**
     1881         * Filter the localized time a post was last modified.
     1882         *
     1883         * @since 2.0.0
     1884         *
     1885         * @param string $the_time The formatted time.
     1886         * @param string $d        Format to use for retrieving the time the post was
     1887         *                         written. Accepts 'G', 'U', or php date format. Defaults
     1888         *                         to value specified in 'time_format' option.
     1889         */
     1890        return apply_filters( 'get_the_modified_time', $the_time, $d );
    15751891}
    15761892
    15771893/**
     
    15941910                $time = $post->post_modified;
    15951911        $time = mysql2date($d, $time, $translate);
    15961912
    1597         return apply_filters('get_post_modified_time', $time, $d, $gmt);
     1913        /**
     1914         * Filter the localized time a post was last modified.
     1915         *
     1916         * @since 2.8.0
     1917         *
     1918         * @param string $time The formatted time.
     1919         * @param string $d    The date format. Accepts 'G', 'U', or php date format. Default 'U'.
     1920         * @param bool   $gmt  Whether to return the GMT time. Default false.
     1921         */
     1922        return apply_filters( 'get_post_modified_time', $time, $d, $gmt );
    15981923}
    15991924
    16001925/**
     
    16071932function the_weekday() {
    16081933        global $wp_locale;
    16091934        $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) );
    1610         $the_weekday = apply_filters('the_weekday', $the_weekday);
     1935
     1936        /**
     1937         * Filter the weekday on which the post was written, for display.
     1938         *
     1939         * @since 0.71
     1940         *
     1941         * @param string $the_weekday
     1942         */
     1943        $the_weekday = apply_filters( 'the_weekday', $the_weekday );
    16111944        echo $the_weekday;
    16121945}
    16131946
     
    16311964                $the_weekday_date .= $after;
    16321965                $previousweekday = $currentday;
    16331966        }
    1634         $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
     1967
     1968        /**
     1969         * Filter the localized date on which the post was written, for display.
     1970         *
     1971         * @since 0.71
     1972         *
     1973         * @param string $the_weekday_date
     1974         * @param string $before           The HTML to output before the date.
     1975         * @param string $after            The HTML to output after the date.
     1976         */
     1977        $the_weekday_date = apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );
    16351978        echo $the_weekday_date;
    16361979}
    16371980
     
    16391982 * Fire the wp_head action
    16401983 *
    16411984 * @since 1.2.0
    1642  * @uses do_action() Calls 'wp_head' hook.
    16431985 */
    16441986function wp_head() {
    1645         do_action('wp_head');
     1987        /**
     1988         * Print scripts or data in the head tag on the front end.
     1989         *
     1990         * @since 1.5.0
     1991         */
     1992        do_action( 'wp_head' );
    16461993}
    16471994
    16481995/**
    16491996 * Fire the wp_footer action
    16501997 *
    16511998 * @since 1.5.1
    1652  * @uses do_action() Calls 'wp_footer' hook.
    16531999 */
    16542000function wp_footer() {
    1655         do_action('wp_footer');
     2001        /**
     2002         * Print scripts or data before the closing body tag on the front end.
     2003         *
     2004         * @since 1.5.1
     2005         */
     2006        do_action( 'wp_footer' );
    16562007}
    16572008
    16582009/**
     
    18322183                }
    18332184        }
    18342185
    1835         return apply_filters('user_can_richedit', $wp_rich_edit);
     2186        /**
     2187         * Filter whether the user can access the rich (Visual) editor.
     2188         *
     2189         * @since 2.1.0
     2190         *
     2191         * @param bool $wp_rich_edit Whether the user can access to the rich (Visual) editor.
     2192         */
     2193        return apply_filters( 'user_can_richedit', $wp_rich_edit );
    18362194}
    18372195
    18382196/**
     
    18512209                $ed = get_user_setting('editor', 'tinymce');
    18522210                $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r;
    18532211        }
    1854         return apply_filters( 'wp_default_editor', $r ); // filter
     2212
     2213        /**
     2214         * Filter which editor should be displayed by default.
     2215         *
     2216         * @since 2.5.0
     2217         *
     2218         * @param array $r An array of editors. Accepts 'tinymce', 'html', 'test'.
     2219         */
     2220        return apply_filters( 'wp_default_editor', $r );
    18552221}
    18562222
    18572223/**
     
    18942260 * @return string
    18952261 */
    18962262function get_search_query( $escaped = true ) {
     2263        /**
     2264         * Filter the contents of the search query variable.
     2265         *
     2266         * @since 2.3.0
     2267         *
     2268         * @oaram mixed $search Contents of the search query variable.
     2269         */
    18972270        $query = apply_filters( 'get_search_query', get_query_var( 's' ) );
     2271
    18982272        if ( $escaped )
    18992273                $query = esc_attr( $query );
    19002274        return $query;
     
    19102284 * @since 2.1.0
    19112285 */
    19122286function the_search_query() {
     2287        /**
     2288         * Filter the contents of the search query variable for display.
     2289         *
     2290         * @since 2.3.0
     2291         *
     2292         * @oaram mixed $search Contents of the search query variable.
     2293         */
    19132294        echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
    19142295}
    19152296
     
    19392320        }
    19402321
    19412322        $output = implode(' ', $attributes);
    1942         $output = apply_filters('language_attributes', $output);
    1943         echo $output;
     2323
     2324        /**
     2325         * Filter the language attributes for display in the html tag.
     2326         *
     2327         * @since 2.5.0
     2328         *
     2329         * @param string $output A space-separated list of language attributes.
     2330         */
     2331        echo apply_filters( 'language_attributes', $output );
    19442332}
    19452333
    19462334/**
     
    20352423                if ( $add_args )
    20362424                        $link = add_query_arg( $add_args, $link );
    20372425                $link .= $add_fragment;
     2426
     2427                /**
     2428                 * Filter the paginated links for the given archive pages.
     2429                 *
     2430                 * @since 3.0.0
     2431                 *
     2432                 * @param string $link The paginated link URL.
     2433                 */
    20382434                $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>';
    20392435        endif;
    20402436        for ( $n = 1; $n <= $total; $n++ ) :
     
    20482444                                if ( $add_args )
    20492445                                        $link = add_query_arg( $add_args, $link );
    20502446                                $link .= $add_fragment;
     2447
     2448                                /** This filter is documented in wp-includes/general-template.php */
    20512449                                $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>";
    20522450                                $dots = true;
    20532451                        elseif ( $dots && !$show_all ) :
     
    20622460                if ( $add_args )
    20632461                        $link = add_query_arg( $add_args, $link );
    20642462                $link .= $add_fragment;
     2463
     2464                /** This filter is documented in wp-includes/general-template.php */
    20652465                $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>';
    20662466        endif;
    20672467        switch ( $type ) :
     
    21912591        }
    21922592        $_file = add_query_arg( 'version', get_bloginfo( 'version' ),  $_file );
    21932593
     2594        /**
     2595         * Filter the URI of a WordPress admin CSS file.
     2596         *
     2597         * @since 2.3.0
     2598         *
     2599         * @param string $_file Relative path to the file with query arguments attached.
     2600         * @param string $file  Relative path to the file, minus its ".css" extension.
     2601         */
    21942602        return apply_filters( 'wp_admin_css_uri', $_file, $file );
    21952603}
    21962604
     
    22312639                return;
    22322640        }
    22332641
     2642        /**
     2643         * Filter the stylesheet link to the specified CSS file.
     2644         *
     2645         * If the site is set to display right-to-left, the RTL stylesheet link
     2646         * will be used instead.
     2647         *
     2648         * @since 2.3.0
     2649         *
     2650         * @param string $file Style handle name or filename (without ".css" extension)
     2651         *                     relative to wp-admin/. Defaults to 'wp-admin'.
     2652         */
    22342653        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() )
     2654
     2655        if ( function_exists( 'is_rtl' ) && is_rtl() ) {
     2656                /** This filter is documented in wp-includes/general-template.php */
    22362657                echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );
     2658        }
    22372659}
    22382660
    22392661/**
     
    22592681 * @since 2.5.0
    22602682 */
    22612683function wp_generator() {
     2684        /**
     2685         * Filter the output of the XHTML generator tag.
     2686         *
     2687         * @since 2.5.0
     2688         *
     2689         * @param string $generator_type The XHTML generator.
     2690         */
    22622691        the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );
    22632692}
    22642693
     
    22692698 * for a plugin to filter generators overall the the_generator filter.
    22702699 *
    22712700 * @since 2.5.0
    2272  * @uses apply_filters() Calls 'the_generator' hook.
    22732701 *
    22742702 * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).
    22752703 */
    22762704function the_generator( $type ) {
    2277         echo apply_filters('the_generator', get_the_generator($type), $type) . "\n";
     2705        /**
     2706         * Filter the output of the XHTML generator tag for display.
     2707         *
     2708         * @since 2.5.0
     2709         *
     2710         * @param string $generator_type The generator output.
     2711         * @param string $type           The type of generator to output. Accepts 'html',
     2712         *                               'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.
     2713         */
     2714        echo apply_filters( 'the_generator', get_the_generator($type), $type ) . "\n";
    22782715}
    22792716
    22802717/**
     
    22852722 * 'get_the_generator_{$type}' filter.
    22862723 *
    22872724 * @since 2.5.0
    2288  * @uses apply_filters() Calls 'get_the_generator_$type' hook.
    22892725 *
    22902726 * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
    22912727 * @return string The HTML content for the generator.
     
    23402776                        $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
    23412777                        break;
    23422778        }
     2779
     2780        /**
     2781         * Filter the HTML for the retrieved generator type.
     2782         *
     2783         * The dynamic portion of the hook name, $type, refers to the generator type.
     2784         *
     2785         * @since 2.5.0
     2786         *
     2787         * @param string $gen  The HTML markup output to 'wp_head()'.
     2788         * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom',
     2789         *                     'rss2', 'rdf', 'comment', 'export'.
     2790         */
    23432791        return apply_filters( "get_the_generator_{$type}", $gen, $type );
    23442792}
    23452793