~canonical-sysadmins/wordpress/3.9.x

« back to all changes in this revision

Viewing changes to wp-includes/general-template.php

  • Committer: Paul Collins
  • Date: 2011-07-13 02:31:10 UTC
  • Revision ID: paul.collins@canonical.com-20110713023110-rvp7cjj31rsaomkr
import Wordpress 3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        if ( isset($name) )
29
29
                $templates[] = "header-{$name}.php";
30
30
 
31
 
        $templates[] = "header.php";
 
31
        $templates[] = 'header.php';
32
32
 
33
33
        // Backward compat code will be removed in a future release
34
34
        if ('' == locate_template($templates, true))
57
57
        if ( isset($name) )
58
58
                $templates[] = "footer-{$name}.php";
59
59
 
60
 
        $templates[] = "footer.php";
 
60
        $templates[] = 'footer.php';
61
61
 
62
62
        // Backward compat code will be removed in a future release
63
63
        if ('' == locate_template($templates, true))
86
86
        if ( isset($name) )
87
87
                $templates[] = "sidebar-{$name}.php";
88
88
 
89
 
        $templates[] = "sidebar.php";
 
89
        $templates[] = 'sidebar.php';
90
90
 
91
91
        // Backward compat code will be removed in a future release
92
92
        if ('' == locate_template($templates, true))
569
569
                $my_year = substr($m, 0, 4);
570
570
                $my_month = $wp_locale->get_month(substr($m, 4, 2));
571
571
                $my_day = intval(substr($m, 6, 2));
572
 
                $title = $my_year . ($my_month ? $t_sep . $my_month : "") . ($my_day ? $t_sep . $my_day : "");
 
572
                $title = $my_year . ( $my_month ? $t_sep . $my_month : '' ) . ( $my_day ? $t_sep . $my_day : '' );
573
573
        }
574
574
 
575
575
        // If there's a year
843
843
        else // custom
844
844
                $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
845
845
 
846
 
        $link_html = apply_filters( "get_archives_link", $link_html );
 
846
        $link_html = apply_filters( 'get_archives_link', $link_html );
847
847
 
848
848
        return $link_html;
849
849
}
915
915
        }
916
916
 
917
917
        //filters
918
 
        $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
919
 
        $join = apply_filters('getarchives_join', "", $r);
 
918
        $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
 
919
        $join = apply_filters( 'getarchives_join', '', $r );
920
920
 
921
921
        $output = '';
922
922
 
1016
1016
                                }
1017
1017
                }
1018
1018
        } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
1019
 
                $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC ";
 
1019
                $orderby = ('alpha' == $type) ? 'post_title ASC ' : 'post_date DESC ';
1020
1020
                $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
1021
1021
                $key = md5($query);
1022
1022
                $cache = wp_cache_get( 'wp_get_archives' , 'general');
1146
1146
 
1147
1147
        /* translators: Calendar caption: 1: month name, 2: 4-digit year */
1148
1148
        $calendar_caption = _x('%1$s %2$s', 'calendar caption');
1149
 
        $calendar_output = '<table id="wp-calendar" summary="' . esc_attr__('Calendar') . '">
 
1149
        $calendar_output = '<table id="wp-calendar">
1150
1150
        <caption>' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>
1151
1151
        <thead>
1152
1152
        <tr>';
1248
1248
                        $calendar_output .= '<td>';
1249
1249
 
1250
1250
                if ( in_array($day, $daywithpost) ) // any posts today?
1251
 
                                $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"" . esc_attr($ak_titles_for_day[$day]) . "\">$day</a>";
 
1251
                                $calendar_output .= '<a href="' . get_day_link( $thisyear, $thismonth, $day ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) . "\">$day</a>";
1252
1252
                else
1253
1253
                        $calendar_output .= $day;
1254
1254
                $calendar_output .= '</td>';
1786
1786
 * @param bool $media_buttons Optional, default is true. Whether to display media buttons.
1787
1787
 * @param int $tab_index Optional, default is 2. Tabindex for textarea element.
1788
1788
 */
1789
 
function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) {
 
1789
function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {
1790
1790
        $rows = get_option('default_post_edit_rows');
1791
1791
        if (($rows < 3) || ($rows > 100))
1792
1792
                $rows = 12;
1839
1839
?>
1840
1840
        <script type="text/javascript">
1841
1841
        edCanvas = document.getElementById('<?php echo $id; ?>');
 
1842
<?php if ( ! $extended ) { ?>   jQuery('#ed_fullscreen, #ed_more').hide();<?php } ?>
1842
1843
        </script>
1843
1844
<?php
 
1845
        // queue scripts
 
1846
        if ( $richedit )
 
1847
                add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
 
1848
        elseif ( $extended )
 
1849
                add_action( 'admin_print_footer_scripts', 'wp_quicktags', 25 );
 
1850
 
1844
1851
}
1845
1852
 
1846
1853
/**
1990
1997
                if ( $add_args )
1991
1998
                        $link = add_query_arg( $add_args, $link );
1992
1999
                $link .= $add_fragment;
1993
 
                $page_links[] = "<a class='prev page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$prev_text</a>";
 
2000
                $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>';
1994
2001
        endif;
1995
2002
        for ( $n = 1; $n <= $total; $n++ ) :
1996
2003
                $n_display = number_format_i18n($n);
2007
2014
                                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>";
2008
2015
                                $dots = true;
2009
2016
                        elseif ( $dots && !$show_all ) :
2010
 
                                $page_links[] = "<span class='page-numbers dots'>...</span>";
 
2017
                                $page_links[] = '<span class="page-numbers dots">...</span>';
2011
2018
                                $dots = false;
2012
2019
                        endif;
2013
2020
                endif;
2018
2025
                if ( $add_args )
2019
2026
                        $link = add_query_arg( $add_args, $link );
2020
2027
                $link .= $add_fragment;
2021
 
                $page_links[] = "<a class='next page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$next_text</a>";
 
2028
                $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>';
2022
2029
        endif;
2023
2030
        switch ( $type ) :
2024
2031
                case 'array' :