Make WordPress Core

Changeset 23778


Ignore:
Timestamp:
03/22/2013 04:15:24 PM (13 years ago)
Author:
lancewillett
Message:

Twenty Ten and Twenty Eleven: revert r23720 and r23721 (closes #23772) and r23718 and r23719 (closes #23774).

Unfortunately, it's too late for these improvements in older themes since it's very likely they'll adversely affect child themes.

Location:
trunk/wp-content/themes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/functions.php

    r23720 r23778  
    328328
    329329/**
    330  * Enqueue scripts and styles.
    331  *
    332  * Hooked on priority 0 to make sure they are enqueued prior to dependent
    333  * scripts/styles. This is only necessary because they were previously enqueued
    334  * prior to wp_head() running, and we want to provide maximum
    335  * backwards compatibility.
    336  *
    337  * @since Twenty Eleven 1.6
    338  */
    339 function twentyeleven_scripts() {
    340     wp_enqueue_style( 'twentyeleven', get_stylesheet_uri() );
    341 
    342     /* We add some JavaScript to pages with the comment form
    343      * to support sites with threaded comments (when in use).
    344      */
    345     if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    346         wp_enqueue_script( 'comment-reply' );
    347 }
    348 add_action( 'wp_enqueue_scripts', 'twentyeleven_scripts', 0 );
    349 
    350 /**
    351330 * Sets the post excerpt length to 40 words.
    352331 *
     
    635614}
    636615add_filter( 'body_class', 'twentyeleven_body_classes' );
    637 
    638 /**
    639  * Creates a nicely formatted and more specific title element text
    640  * for output in head of document, based on current view.
    641  *
    642  * @since Twenty Eleven 1.6
    643  *
    644  * @param string $title Default title text for current view.
    645  * @param string $sep Optional separator.
    646  * @return string Filtered title.
    647  */
    648 function twentyeleven_wp_title( $title, $sep ) {
    649     global $paged, $page;
    650 
    651     if ( is_feed() )
    652         return $title;
    653 
    654     // Add the site name.
    655     $title .= get_bloginfo( 'name' );
    656 
    657     // Add the site description for the home/front page.
    658     $site_description = get_bloginfo( 'description', 'display' );
    659     if ( $site_description && ( is_home() || is_front_page() ) )
    660         $title = "$title $sep $site_description";
    661 
    662     // Add a page number if necessary.
    663     if ( $paged >= 2 || $page >= 2 )
    664         $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
    665 
    666     return $title;
    667 }
    668 add_filter( 'wp_title', 'twentyeleven_wp_title', 10, 2 );
  • trunk/wp-content/themes/twentyeleven/header.php

    r23720 r23778  
    2525<meta charset="<?php bloginfo( 'charset' ); ?>" />
    2626<meta name="viewport" content="width=device-width" />
    27 <title><?php wp_title( '|', true, 'right' ); ?></title>
     27<title><?php
     28    /*
     29     * Print the <title> tag based on what is being viewed.
     30     */
     31    global $page, $paged;
     32
     33    wp_title( '|', true, 'right' );
     34
     35    // Add the blog name.
     36    bloginfo( 'name' );
     37
     38    // Add the blog description for the home/front page.
     39    $site_description = get_bloginfo( 'description', 'display' );
     40    if ( $site_description && ( is_home() || is_front_page() ) )
     41        echo " | $site_description";
     42
     43    // Add a page number if necessary:
     44    if ( $paged >= 2 || $page >= 2 )
     45        echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
     46
     47    ?></title>
    2848<link rel="profile" href="http://gmpg.org/xfn/11" />
     49<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    2950<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    3051<!--[if lt IE 9]>
     
    3253<![endif]-->
    3354<?php
     55    /* We add some JavaScript to pages with the comment form
     56     * to support sites with threaded comments (when in use).
     57     */
     58    if ( is_singular() && get_option( 'thread_comments' ) )
     59        wp_enqueue_script( 'comment-reply' );
     60
    3461    /* Always have wp_head() just before the closing </head>
    3562     * tag of your theme, or you will break many plugins, which
  • trunk/wp-content/themes/twentyten/functions.php

    r23721 r23778  
    215215}
    216216endif;
    217 
    218 /**
    219  * Enqueue scripts and styles.
    220  *
    221  * Hooked on priority 0 to make sure they are enqueued prior to dependent
    222  * scripts/styles. This is only necessary because they were previously enqueued
    223  * prior to wp_head() running, and we want to provide maximum
    224  * backwards compatibility.
    225  *
    226  * @since Twenty Ten 1.6
    227  */
    228 function twentyten_scripts() {
    229     wp_enqueue_style( 'twentyten', get_stylesheet_uri() );
    230 
    231     /* We add some JavaScript to pages with the comment form
    232      * to support sites with threaded comments (when in use).
    233      */
    234     if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    235         wp_enqueue_script( 'comment-reply' );
    236 }
    237 add_action( 'wp_enqueue_scripts', 'twentyten_scripts', 0 );
    238217
    239218/**
     
    536515}
    537516endif;
    538 
    539 /**
    540  * Creates a nicely formatted and more specific title element text
    541  * for output in head of document, based on current view.
    542  *
    543  * @since Twenty Ten 1.6
    544  *
    545  * @param string $title Default title text for current view.
    546  * @param string $sep Optional separator.
    547  * @return string Filtered title.
    548  */
    549 function twentyten_wp_title( $title, $sep ) {
    550     global $paged, $page;
    551 
    552     if ( is_feed() )
    553         return $title;
    554 
    555     // Add the site name.
    556     $title .= get_bloginfo( 'name' );
    557 
    558     // Add the site description for the home/front page.
    559     $site_description = get_bloginfo( 'description', 'display' );
    560     if ( $site_description && ( is_home() || is_front_page() ) )
    561         $title = "$title $sep $site_description";
    562 
    563     // Add a page number if necessary.
    564     if ( $paged >= 2 || $page >= 2 )
    565         $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    566 
    567     return $title;
    568 }
    569 add_filter( 'wp_title', 'twentyten_wp_title', 10, 2 );
  • trunk/wp-content/themes/twentyten/header.php

    r23721 r23778  
    1313<head>
    1414<meta charset="<?php bloginfo( 'charset' ); ?>" />
    15 <title><?php wp_title( '|', true, 'right' ); ?></title>
     15<title><?php
     16    /*
     17     * Print the <title> tag based on what is being viewed.
     18     */
     19    global $page, $paged;
     20
     21    wp_title( '|', true, 'right' );
     22
     23    // Add the blog name.
     24    bloginfo( 'name' );
     25
     26    // Add the blog description for the home/front page.
     27    $site_description = get_bloginfo( 'description', 'display' );
     28    if ( $site_description && ( is_home() || is_front_page() ) )
     29        echo " | $site_description";
     30
     31    // Add a page number if necessary:
     32    if ( $paged >= 2 || $page >= 2 )
     33        echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
     34
     35    ?></title>
    1636<link rel="profile" href="http://gmpg.org/xfn/11" />
     37<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    1738<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    1839<?php
     40    /* We add some JavaScript to pages with the comment form
     41     * to support sites with threaded comments (when in use).
     42     */
     43    if ( is_singular() && get_option( 'thread_comments' ) )
     44        wp_enqueue_script( 'comment-reply' );
     45
    1946    /* Always have wp_head() just before the closing </head>
    2047     * tag of your theme, or you will break many plugins, which
Note: See TracChangeset for help on using the changeset viewer.