273
273
<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . site_url( 'wp-login.php', 'login' ) . '" method="post">
274
' . apply_filters( 'login_form_top', '' ) . '
274
' . apply_filters( 'login_form_top', '', $args ) . '
275
275
<p class="login-username">
276
276
<label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>
277
277
<input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" tabindex="10" />
280
280
<label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label>
281
281
<input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" tabindex="20" />
283
' . apply_filters( 'login_form_middle', '' ) . '
283
' . apply_filters( 'login_form_middle', '', $args ) . '
284
284
' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever" tabindex="90"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '
285
285
<p class="login-submit">
286
286
<input type="submit" name="wp-submit" id="' . esc_attr( $args['id_submit'] ) . '" class="button-primary" value="' . esc_attr( $args['label_log_in'] ) . '" tabindex="100" />
287
287
<input type="hidden" name="redirect_to" value="' . esc_attr( $args['redirect'] ) . '" />
289
' . apply_filters( 'login_form_bottom', '' ) . '
289
' . apply_filters( 'login_form_bottom', '', $args ) . '
292
292
if ( $args['echo'] )
514
526
* @return string|null String on retrieve, null when displaying.
516
528
function wp_title($sep = '»', $display = true, $seplocation = '') {
517
global $wpdb, $wp_locale, $wp_query;
529
global $wpdb, $wp_locale;
519
$cat = get_query_var('cat');
520
$tag = get_query_var('tag_id');
521
$category_name = get_query_var('category_name');
522
$author = get_query_var('author');
523
$author_name = get_query_var('author_name');
524
531
$m = get_query_var('m');
525
532
$year = get_query_var('year');
526
533
$monthnum = get_query_var('monthnum');
531
538
$t_sep = '%WP_TITILE_SEP%'; // Temporary separator, for accurate flipping, if necessary
533
// If there's a category
534
if ( !empty($cat) ) {
535
// category exclusion
536
if ( !stristr($cat,'-') )
537
$title = apply_filters('single_cat_title', get_the_category_by_ID($cat));
538
} elseif ( !empty($category_name) ) {
539
if ( stristr($category_name,'/') ) {
540
$category_name = explode('/',$category_name);
541
if ( $category_name[count($category_name)-1] )
542
$category_name = $category_name[count($category_name)-1]; // no trailing slash
544
$category_name = $category_name[count($category_name)-2]; // there was a trailling slash
546
$cat = get_term_by('slug', $category_name, 'category', OBJECT, 'display');
548
$title = apply_filters('single_cat_title', $cat->name);
551
if ( !empty($tag) ) {
552
$tag = get_term($tag, 'post_tag', OBJECT, 'display');
553
if ( is_wp_error( $tag ) )
555
if ( ! empty($tag->name) )
556
$title = apply_filters('single_tag_title', $tag->name);
540
// If there is a post
541
if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
542
$title = single_post_title( '', false );
545
// If there's a category or tag
546
if ( is_category() || is_tag() ) {
547
$title = single_term_title( '', false );
550
// If there's a taxonomy
552
$term = get_queried_object();
553
$tax = get_taxonomy( $term->taxonomy );
554
$title = single_term_title( $tax->labels->name . $t_sep, false );
559
557
// If there's an author
560
if ( !empty($author) ) {
561
$title = get_userdata($author);
562
$title = $title->display_name;
564
if ( !empty($author_name) ) {
565
// We do a direct query here because we don't cache by nicename.
566
$title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name));
559
$author = get_queried_object();
560
$title = $author->display_name;
563
// If there's a post type archive
564
if ( is_post_type_archive() )
565
$title = post_type_archive_title( '', false );
569
567
// If there's a month
568
if ( is_archive() && !empty($m) ) {
571
569
$my_year = substr($m, 0, 4);
572
570
$my_month = $wp_locale->get_month(substr($m, 4, 2));
573
571
$my_day = intval(substr($m, 6, 2));
574
572
$title = $my_year . ($my_month ? $t_sep . $my_month : "") . ($my_day ? $t_sep . $my_day : "");
577
if ( !empty($year) ) {
576
if ( is_archive() && !empty($year) ) {
579
578
if ( !empty($monthnum) )
580
579
$title .= $t_sep . $wp_locale->get_month($monthnum);
582
581
$title .= $t_sep . zeroise($day, 2);
585
// If there is a post
586
if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
587
$post = $wp_query->get_queried_object();
588
$title = apply_filters( 'single_post_title', $post->post_title );
591
// If there's a taxonomy
593
$taxonomy = get_query_var( 'taxonomy' );
594
$tax = get_taxonomy( $taxonomy );
595
$term = $wp_query->get_queried_object();
597
$title = $tax->labels->name . $t_sep . $term;
601
585
if ( is_search() ) {
602
586
/* translators: 1: separator, 2: search phrase */
603
587
$title = sprintf(__('Search Results %1$s %2$s'), $t_sep, strip_tags($search));
590
// If it's a 404 page
606
591
if ( is_404() ) {
607
592
$title = __('Page not found');
643
627
* be a space, the parameter value will need to have it at the end.
648
631
* @param string $prefix Optional. What to display before the title.
649
632
* @param bool $display Optional, default is true. Whether to display or retrieve title.
650
633
* @return string|null Title when retrieving, null when displaying or failure.
652
635
function single_post_title($prefix = '', $display = true) {
653
global $wp_query, $post;
656
$_post = $wp_query->get_queried_object();
636
$_post = get_queried_object();
660
638
if ( !isset($_post->post_title) )
649
* Display or retrieve title for a post type archive.
651
* This is optimized for archive.php and archive-{$post_type}.php template files
652
* for displaying the title of the post type.
656
* @param string $prefix Optional. What to display before the title.
657
* @param bool $display Optional, default is true. Whether to display or retrieve title.
658
* @return string|null Title when retrieving, null when displaying or failure.
660
function post_type_archive_title( $prefix = '', $display = true ) {
661
if ( ! is_post_type_archive() )
664
$post_type_obj = get_queried_object();
665
$title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
668
echo $prefix . $title;
671
674
* Display or retrieve page title for category archive.
673
676
* This is useful for category template file or files, because it is optimized
684
687
* @param bool $display Optional, default is true. Whether to display or retrieve title.
685
688
* @return string|null Title when retrieving, null when displaying or failure.
687
function single_cat_title($prefix = '', $display = true ) {
691
return single_tag_title($prefix, $display);
693
if ( !is_category() )
696
$cat = $wp_query->get_queried_object();
697
$my_cat_name = apply_filters('single_cat_title', $cat->name);
698
if ( !empty($my_cat_name) ) {
700
echo $prefix . $my_cat_name;
690
function single_cat_title( $prefix = '', $display = true ) {
691
return single_term_title( $prefix, $display );
720
708
* @param bool $display Optional, default is true. Whether to display or retrieve title.
721
709
* @return string|null Title when retrieving, null when displaying or failure.
723
function single_tag_title($prefix = '', $display = true ) {
728
$tag = $wp_query->get_queried_object();
733
$my_tag_name = apply_filters('single_tag_title', $tag->name);
734
if ( !empty($my_tag_name) ) {
736
echo $prefix . $my_tag_name;
711
function single_tag_title( $prefix = '', $display = true ) {
712
return single_term_title( $prefix, $display );
716
* Display or retrieve page title for taxonomy term archive.
718
* Useful for taxonomy term template files for displaying the taxonomy term page title.
719
* It has less overhead than {@link wp_title()}, because of its limited implementation.
721
* It does not support placing the separator after the title, but by leaving the
722
* prefix parameter empty, you can set the title separator manually. The prefix
723
* does not automatically place a space between the prefix, so if there should
724
* be a space, the parameter value will need to have it at the end.
728
* @param string $prefix Optional. What to display before the title.
729
* @param bool $display Optional, default is true. Whether to display or retrieve title.
730
* @return string|null Title when retrieving, null when displaying or failure.
732
function single_term_title( $prefix = '', $display = true ) {
733
$term = get_queried_object();
739
$term_name = apply_filters( 'single_cat_title', $term->name );
741
$term_name = apply_filters( 'single_tag_title', $term->name );
743
$term_name = apply_filters( 'single_term_title', $term->name );
747
if ( empty( $term_name ) )
751
echo $prefix . $term_name;
1101
1115
// We need to get the month from MySQL
1102
1116
$thisyear = ''.intval(substr($m, 0, 4));
1103
1117
$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
1104
$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
1118
$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");
1105
1119
} elseif ( !empty($m) ) {
1106
1120
$thisyear = ''.intval(substr($m, 0, 4));
1107
1121
if ( strlen($m) < 6 )
1116
1130
$unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);
1131
$last_day = date('t', $unixmonth);
1118
1133
// Get the next and previous month and year with at least one post
1119
$previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
1134
$previous = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
1120
1135
FROM $wpdb->posts
1121
1136
WHERE post_date < '$thisyear-$thismonth-01'
1122
1137
AND post_type = 'post' AND post_status = 'publish'
1123
1138
ORDER BY post_date DESC
1125
$next = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
1140
$next = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
1126
1141
FROM $wpdb->posts
1127
WHERE post_date > '$thisyear-$thismonth-01'
1128
AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
1142
WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'
1129
1143
AND post_type = 'post' AND post_status = 'publish'
1130
ORDER BY post_date ASC
1144
ORDER BY post_date ASC
1133
1147
/* translators: Calendar caption: 1: month name, 2: 4-digit year */
1159
1173
if ( $previous ) {
1160
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
1174
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
1162
1176
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>';
1180
1194
// Get days with posts
1181
1195
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
1182
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
1183
AND YEAR(post_date) = '$thisyear'
1196
FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
1184
1197
AND post_type = 'post' AND post_status = 'publish'
1185
AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
1198
AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N);
1186
1199
if ( $dayswithposts ) {
1187
1200
foreach ( (array) $dayswithposts as $daywith ) {
1188
1201
$daywithpost[] = $daywith[0];
1199
1212
$ak_titles_for_day = array();
1200
1213
$ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom "
1201
1214
."FROM $wpdb->posts "
1202
."WHERE YEAR(post_date) = '$thisyear' "
1203
."AND MONTH(post_date) = '$thismonth' "
1204
."AND post_date < '".current_time('mysql')."' "
1215
."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' "
1216
."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' "
1205
1217
."AND post_type = 'post' AND post_status = 'publish'"
1207
1219
if ( $ak_post_titles ) {
1334
1346
* @return string|null Null if displaying, string if retrieving.
1336
1348
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
1337
global $day, $previousday;
1349
global $currentday, $previousday;
1338
1350
$the_date = '';
1339
if ( $day != $previousday ) {
1351
if ( $currentday != $previousday ) {
1340
1352
$the_date .= $before;
1341
1353
$the_date .= get_the_date( $d );
1342
1354
$the_date .= $after;
1343
$previousday = $day;
1355
$previousday = $currentday;
1345
1357
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
1543
1555
* @param string $before Optional Output before the date.
1544
1556
* @param string $after Optional Output after the date.
1546
1558
function the_weekday_date($before='',$after='') {
1547
1559
global $wp_locale, $post, $day, $previousweekday;
1548
1560
$the_weekday_date = '';
1549
if ( $day != $previousweekday ) {
1561
if ( $currentday != $previousweekday ) {
1550
1562
$the_weekday_date .= $before;
1551
1563
$the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
1552
1564
$the_weekday_date .= $after;
1553
$previousweekday = $day;
1565
$previousweekday = $currentday;
1555
1567
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
1556
1568
echo $the_weekday_date;
1635
1647
$href = get_post_comments_feed_link( $post->ID );
1637
1649
} elseif ( is_category() ) {
1638
$cat_id = intval( get_query_var('cat') );
1650
$term = get_queried_object();
1640
$title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) ));
1641
$href = get_category_feed_link( $cat_id );
1652
$title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ));
1653
$href = get_category_feed_link( $term->term_id );
1642
1654
} elseif ( is_tag() ) {
1643
$tag_id = intval( get_query_var('tag_id') );
1644
$tag = get_tag( $tag_id );
1655
$term = get_queried_object();
1646
$title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name ));
1647
$href = get_tag_feed_link( $tag_id );
1657
$title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ));
1658
$href = get_tag_feed_link( $term->term_id );
1648
1659
} elseif ( is_author() ) {
1649
1660
$author_id = intval( get_query_var('author') );
2039
2050
* @param string $key The unique key for this theme.
2040
2051
* @param string $name The name of the theme.
2041
2052
* @param string $url The url of the css file containing the colour scheme.
2042
* @param array @colors Optional An array of CSS color definitions which are used to give the user a feel for the theme.
2053
* @param array $colors Optional An array of CSS color definitions which are used to give the user a feel for the theme.
2044
2055
function wp_admin_css_color($key, $name, $url, $colors = array()) {
2045
2056
global $_wp_admin_css_colors;
2058
2069
function register_admin_color_schemes() {
2059
wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
2060
wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));}
2070
wp_admin_css_color( 'classic', __( 'Blue' ), admin_url( 'css/colors-classic.css' ),
2071
array( '#5589aa', '#cfdfe9', '#d1e5ee', '#eff8ff' ) );
2072
wp_admin_css_color( 'fresh', __( 'Gray' ), admin_url( 'css/colors-fresh.css' ),
2073
array( '#7c7976', '#c6c6c6', '#e0e0e0', '#f1f1f1' ) );
2063
2077
* Display the URL of a WordPress admin CSS file.
2098
2112
* @uses $wp_styles WordPress Styles Object
2100
* @param string $file Style handle name or file name (without ".css" extension) relative to wp-admin/
2114
* @param string $file Optional. Style handle name or file name (without ".css" extension) relative
2115
* to wp-admin/. Defaults to 'wp-admin'.
2101
2116
* @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
2103
2118
function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {