Make WordPress Core

Ticket #27719: 27719.4.diff

File 27719.4.diff, 26.1 KB (added by kpdesign, 12 years ago)

Fourth pass

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

     
    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();
     
    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();
     
    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();
     
    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 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         */
    123170        do_action( "get_template_part_{$slug}", $slug, $name );
    124171
    125172        $templates = array();
     
    157204 * @return string|null String when retrieving, null when displaying or if searchform.php exists.
    158205 */
    159206function 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         */
    160215        do_action( 'pre_get_search_form' );
    161216
    162217        $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         */
    163227        $format = apply_filters( 'search_form_format', $format );
    164228
    165229        $search_form_template = locate_template( 'searchform.php' );
     
    187251                }
    188252        }
    189253
     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         */
    190261        $result = apply_filters( 'get_search_form', $form );
    191262        if ( null === $result )
    192263                $result = $form;
     
    216287        else
    217288                $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
    218289
    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        }
    223303}
    224304
    225305/**
     
    244324        $logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
    245325        $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    246326
    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 );
    248336}
    249337
    250338/**
     
    269357        if ( $force_reauth )
    270358                $login_url = add_query_arg('reauth', '1', $login_url);
    271359
    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 );
    273369}
    274370
    275371/**
     
    284380 * @return string
    285381 */
    286382function 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         */
    287390        return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
    288391}
    289392
     
    312415                'value_username' => '',
    313416                'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked
    314417        );
     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         */
    315428        $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );
    316429
    317430        $form = '
     
    359472        }
    360473
    361474        $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         */
    362484        return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
    363485}
    364486
     
    387509                $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
    388510        }
    389511
    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        }
    394525}
    395526
    396527/**
     
    404535 * @uses do_action() Calls 'wp_meta' hook.
    405536 */
    406537function 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' );
    408544}
    409545
    410546/**
     
    529665                $url = false;
    530666
    531667        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                }
    536689        }
    537690
    538691        return $output;
     
    654807                $title = $prefix . implode( " $sep ", $title_array );
    655808        }
    656809
    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 );
    658820
    659821        // Send it out
    660822        if ( $display )
     
    686848        if ( !isset($_post->post_title) )
    687849                return;
    688850
    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 );
    690860        if ( $display )
    691861                echo $prefix . $title;
    692862        else
     
    714884                $post_type = reset( $post_type );
    715885
    716886        $post_type_obj = get_post_type_object( $post_type );
     887
    717888        /**
    718889         * Filter the post type archive title.
    719890         *
     
    795966        if ( !$term )
    796967                return;
    797968
    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                 */
    799977                $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                 */
    801986                $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                 */
    803995                $term_name = apply_filters( 'single_term_title', $term->name );
    804         else
     996        } else
    805997                return;
    806998
    807999        if ( empty( $term_name ) )
     
    9021094        else // custom
    9031095                $link_html = "\t$before<a href='$url'>$text</a>$after\n";
    9041096
     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         */
    9051104        $link_html = apply_filters( 'get_archives_link', $link_html );
    9061105
    9071106        return $link_html;
     
    9781177                $archive_week_end_date_format = get_option('date_format');
    9791178        }
    9801179
     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         */
    9811188        $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         */
    9821198        $join = apply_filters( 'getarchives_join', '', $r );
    9831199
    9841200        $output = '';
     
    11371353        if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
    11381354                if ( is_array($cache) && isset( $cache[ $key ] ) ) {
    11391355                        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] );
    11411364                                return;
    11421365                        } 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] );
    11441368                        }
    11451369                }
    11461370        }
     
    13231547        $cache[ $key ] = $calendar_output;
    13241548        wp_cache_set( 'get_calendar', $cache, 'calendar' );
    13251549
    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        }
    13301557
    13311558}
    13321559
     
    14081635                $the_date = $before . get_the_date( $d ) . $after;
    14091636                $previousday = $currentday;
    14101637
     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                 */
    14111649                $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
    14121650
    14131651                if ( $echo )
     
    14411679        }
    14421680
    14431681        /**
    1444          * Filter the date returned from the get_the_date function.
     1682         * Filter the retrieved date a post was written.
    14451683         *
    14461684         * @since 3.0.0
    14471685         *
    14481686         * @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.
    14511690         */
    14521691        return apply_filters( 'get_the_date', $the_date, $d, $post );
    14531692}
     
    14661705function the_modified_date($d = '', $before='', $after='', $echo = true) {
    14671706
    14681707        $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);
    14701708
     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
    14711722        if ( $echo )
    14721723                echo $the_modified_date;
    14731724        else
     
    14881739                $the_time = get_post_modified_time(get_option('date_format'), null, null, true);
    14891740        else
    14901741                $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 );
    14921752}
    14931753
    14941754/**
     
    14991759 * @param string $d Either 'G', 'U', or php date format.
    15001760 */
    15011761function 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 );
    15031772}
    15041773
    15051774/**
     
    15201789                $the_time = get_post_time(get_option('time_format'), false, $post, true);
    15211790        else
    15221791                $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 );
    15241804}
    15251805
    15261806/**
     
    15441824                $time = $post->post_date;
    15451825
    15461826        $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 );
    15481839}
    15491840
    15501841/**
     
    15551846 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
    15561847 */
    15571848function 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 );
    15591860}
    15601861
    15611862/**
     
    15711872                $the_time = get_post_modified_time(get_option('time_format'), null, null, true);
    15721873        else
    15731874                $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 );
    15751887}
    15761888
    15771889/**
     
    15941906                $time = $post->post_modified;
    15951907        $time = mysql2date($d, $time, $translate);
    15961908
    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 );
    15981919}
    15991920
    16001921/**
     
    16071928function the_weekday() {
    16081929        global $wp_locale;
    16091930        $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 );
    16111940        echo $the_weekday;
    16121941}
    16131942
     
    16311960                $the_weekday_date .= $after;
    16321961                $previousweekday = $currentday;
    16331962        }
    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 );
    16351974        echo $the_weekday_date;
    16361975}
    16371976
     
    16421981 * @uses do_action() Calls 'wp_head' hook.
    16431982 */
    16441983function 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' );
    16461990}
    16471991
    16481992/**
     
    16521996 * @uses do_action() Calls 'wp_footer' hook.
    16531997 */
    16541998function 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' );
    16562005}
    16572006
    16582007/**
     
    18322181                }
    18332182        }
    18342183
    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 );
    18362192}
    18372193
    18382194/**
     
    18512207                $ed = get_user_setting('editor', 'tinymce');
    18522208                $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r;
    18532209        }
    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 );
    18552219}
    18562220
    18572221/**
     
    18942258 * @return string
    18952259 */
    18962260function 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         */
    18972268        $query = apply_filters( 'get_search_query', get_query_var( 's' ) );
    18982269        if ( $escaped )
    18992270                $query = esc_attr( $query );
     
    19102281 * @since 2.1.0
    19112282 */
    19122283function 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         */
    19132291        echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
    19142292}
    19152293
     
    19392317        }
    19402318
    19412319        $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 );
    19432329        echo $output;
    19442330}
    19452331
     
    20352421                if ( $add_args )
    20362422                        $link = add_query_arg( $add_args, $link );
    20372423                $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                 */
    20382432                $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>';
    20392433        endif;
    20402434        for ( $n = 1; $n <= $total; $n++ ) :
     
    20482442                                if ( $add_args )
    20492443                                        $link = add_query_arg( $add_args, $link );
    20502444                                $link .= $add_fragment;
     2445
     2446                                /** This filter is documented in wp-includes/general-template.php */
    20512447                                $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>";
    20522448                                $dots = true;
    20532449                        elseif ( $dots && !$show_all ) :
     
    20622458                if ( $add_args )
    20632459                        $link = add_query_arg( $add_args, $link );
    20642460                $link .= $add_fragment;
     2461
     2462                /** This filter is documented in wp-includes/general-template.php */
    20652463                $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>';
    20662464        endif;
    20672465        switch ( $type ) :
     
    21912589        }
    21922590        $_file = add_query_arg( 'version', get_bloginfo( 'version' ),  $_file );
    21932591
     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         */
    21942600        return apply_filters( 'wp_admin_css_uri', $_file, $file );
    21952601}
    21962602
     
    22312637                return;
    22322638        }
    22332639
     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         */
    22342648        echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file );
    22352649        if ( function_exists( 'is_rtl' ) && is_rtl() )
     2650                /** This filter is documented in wp-includes/general-template.php */
    22362651                echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );
    22372652}
    22382653
     
    22592674 * @since 2.5.0
    22602675 */
    22612676function wp_generator() {
     2677        /**
     2678         * Filter the XHTML generator.
     2679         *
     2680         * @since 2.5.0
     2681         *
     2682         * @param string $generator_type The XHTML generator.
     2683         */
    22622684        the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );
    22632685}
    22642686
     
    22742696 * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).
    22752697 */
    22762698function 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";
    22782709}
    22792710
    22802711/**
     
    23402771                        $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
    23412772                        break;
    23422773        }
     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         */
    23432786        return apply_filters( "get_the_generator_{$type}", $gen, $type );
    23442787}
    23452788