Make WordPress Core

Ticket #27719: 27719.2.diff

File 27719.2.diff, 5.7 KB (added by jesin, 12 years ago)

Docs for loginout, bloginfo_url, bloginfo, single_cat_title, single_tag_title, single_term_title, get_archives_link, getarchives_where, get_calendar, the_date, the_modified_date, get_the_modified_date, the_time

  • wp-includes/general-template.php

     
    216216        else
    217217                $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
    218218
    219         if ( $echo )
     219        if ( $echo ) {
     220                /**
     221                 * Filter the HTML Log In/Out link.
     222                 *
     223                 * @since 1.5.2
     224                 *
     225                 * @param string $link HTML link content for Log In/Out.
     226                 */
    220227                echo apply_filters('loginout', $link);
    221         else
     228        }
     229        else {
     230                /** This filter is documented in wp-includes/general-template.php */
    222231                return apply_filters('loginout', $link);
     232        }
    223233}
    224234
    225235/**
     
    529539                $url = false;
    530540
    531541        if ( 'display' == $filter ) {
    532                 if ( $url )
     542                if ( $url ) {
     543                        /**
     544                         * Filter the URL returned by get_bloginfo().
     545                         *
     546                         * @since 2.0.11
     547                         *
     548                         * @param string $output The URL returned by bloginfo().
     549                         * @param string $show   The keyword naming the information requested.
     550                         */
    533551                        $output = apply_filters('bloginfo_url', $output, $show);
    534                 else
     552                }
     553                else {
     554                        /**
     555                         *  Filter the information returned by get_bloginfo().
     556                         *
     557                         * @since 1.2.1
     558                         *
     559                         * @param string $output The non-URL information mentioned in $show.
     560                         * @param string $show   The keyword naming the information requested.
     561                         */
    535562                        $output = apply_filters('bloginfo', $output, $show);
     563                }
    536564        }
    537565
    538566        return $output;
     
    795823        if ( !$term )
    796824                return;
    797825
    798         if ( is_category() )
     826        if ( is_category() ) {
     827                /**
     828                 * Filter the page title for category archive.
     829                 *
     830                 * @since 2.0.11
     831                 *
     832                 * @param string $term_name Name of the category whose archive is being displayed
     833                 */
    799834                $term_name = apply_filters( 'single_cat_title', $term->name );
    800         elseif ( is_tag() )
     835        }
     836        elseif ( is_tag() ) {
     837                /**
     838                 * Filter the page title for tag archive.
     839                 *
     840                 * @since 2.3
     841                 *
     842                 * @param string $term_name Name of the category whose archive is being displayed
     843                 */
    801844                $term_name = apply_filters( 'single_tag_title', $term->name );
    802         elseif ( is_tax() )
     845        }
     846        elseif ( is_tax() ) {
     847                /**
     848                 * Filter the page title for custom taxonomy archive page.
     849                 *
     850                 * @since 3.1
     851                 *
     852                 * @param string $term_name Name of the category whose archive is being displayed
     853                 */
    803854                $term_name = apply_filters( 'single_term_title', $term->name );
     855        }
    804856        else
    805857                return;
    806858
     
    902954        else // custom
    903955                $link_html = "\t$before<a href='$url'>$text</a>$after\n";
    904956
     957        /**
     958         * Filter the HTML link content for archive.
     959         *
     960         * @since 2.6
     961         *
     962         * @param string HTML link content for archive.
     963         */
    905964        $link_html = apply_filters( 'get_archives_link', $link_html );
    906965
    907966        return $link_html;
     
    9781037                $archive_week_end_date_format = get_option('date_format');
    9791038        }
    9801039
     1040        /**
     1041         * Filter the SQL WHERE clause for retrieving archives.
     1042         *
     1043         * @since 2.2
     1044         *
     1045         * @param string $sql_where Portion of SQL query containing WHERE clause.
     1046         * @param array  $r         The arguments of the wp_get_archives() function.
     1047         */
    9811048        $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
    9821049        $join = apply_filters( 'getarchives_join', '', $r );
    9831050
     
    11371204        if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
    11381205                if ( is_array($cache) && isset( $cache[ $key ] ) ) {
    11391206                        if ( $echo ) {
     1207                                /**
     1208                                 * Filter the HTML output of the get_calender_function.
     1209                                 *
     1210                                 * @since 3.0
     1211                                 *
     1212                                 * @param string $cache_key HTML output of the calendar.
     1213                                 */
    11401214                                echo apply_filters( 'get_calendar',  $cache[$key] );
    11411215                                return;
    11421216                        } else {
     1217                                /** This filter is documented in wp-includes/general-template.php */
    11431218                                return apply_filters( 'get_calendar',  $cache[$key] );
    11441219                        }
    11451220                }
     
    14081483                $the_date = $before . get_the_date( $d ) . $after;
    14091484                $previousday = $currentday;
    14101485
     1486                /**
     1487                 * Filter the date returned by the the_date() function.
     1488                 *
     1489                 * @since 1.2.1
     1490                 *
     1491                 * @param string $the_date The formatted date string.
     1492                 * @param string $d        PHP date format.
     1493                 * @param string $before   Output before the date.
     1494                 * @param string $after    Output after the date.
     1495                 */
    14111496                $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
    14121497
    14131498                if ( $echo )
     
    14661551function the_modified_date($d = '', $before='', $after='', $echo = true) {
    14671552
    14681553        $the_modified_date = $before . get_the_modified_date($d) . $after;
     1554        /**
     1555         * Filter the date on returned by the the_modified_date() function.
     1556         *
     1557         * @since 2.1.0
     1558         *
     1559         * @param string $the_modified_date The formatted date.
     1560         * @param string $d                 PHP date format.
     1561         * @param string $before            Output before the date.
     1562         * @param string $after             Output after the date.
     1563         */
    14691564        $the_modified_date = apply_filters('the_modified_date', $the_modified_date, $d, $before, $after);
    14701565
    14711566        if ( $echo )
     
    14881583                $the_time = get_post_modified_time(get_option('date_format'), null, null, true);
    14891584        else
    14901585                $the_time = get_post_modified_time($d, null, null, true);
     1586        /**
     1587         * Filter the date returned by the get_the_modified_date() function.
     1588         *
     1589         * @since 2.1.0
     1590         *
     1591         * @param string $the_time The formatted date.
     1592         * @param string $d        PHP date formate.
     1593         */
    14911594        return apply_filters('get_the_modified_date', $the_time, $d);
    14921595}
    14931596
     
    14991602 * @param string $d Either 'G', 'U', or php date format.
    15001603 */
    15011604function the_time( $d = '' ) {
     1605        /**
     1606         * Filter the time returned by the the_time() function.
     1607         *
     1608         * @since 1.2.1
     1609         *
     1610         * @param string $get_the_time The formatted date.
     1611         * @param string $d            PHP date format.
     1612         */
    15021613        echo apply_filters('the_time', get_the_time( $d ), $d);
    15031614}
    15041615