Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15391 r17478  
    7878        add_editor_style();
    7979
     80        // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
     81        add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
     82
    8083        // This theme uses post thumbnails
    8184        add_theme_support( 'post-thumbnails' );
     
    102105
    103106        // Your changeable header business starts here
    104         define( 'HEADER_TEXTCOLOR', '' );
     107        if ( ! defined( 'HEADER_TEXTCOLOR' ) )
     108                define( 'HEADER_TEXTCOLOR', '' );
     109
    105110        // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
    106         define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' );
     111        if ( ! defined( 'HEADER_IMAGE' ) )
     112                define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' );
    107113
    108114        // The height and width of your custom header. You can hook into the theme's own filters to change these values.
     
    117123
    118124        // Don't support text inside the header image.
    119         define( 'NO_HEADER_TEXT', true );
     125        if ( ! defined( 'NO_HEADER_TEXT' ) )
     126                define( 'NO_HEADER_TEXT', true );
    120127
    121128        // Add a way for the custom header to be styled in the admin panel that controls
     
    276283 * Remove inline styles printed when the gallery shortcode is used.
    277284 *
    278  * Galleries are styled by the theme in Twenty Ten's style.css.
    279  *
    280  * @since Twenty Ten 1.0
     285 * Galleries are styled by the theme in Twenty Ten's style.css. This is just
     286 * a simple filter call that tells WordPress to not use the default styles.
     287 *
     288 * @since Twenty Ten 1.2
     289 */
     290add_filter( 'use_default_gallery_style', '__return_false' );
     291
     292/**
     293 * Deprecated way to remove inline styles printed when the gallery shortcode is used.
     294 *
     295 * This function is no longer needed or used. Use the use_default_gallery_style
     296 * filter instead, as seen above.
     297 *
     298 * @since Twenty Ten 1.0
     299 * @deprecated Deprecated in Twenty Ten 1.2 for WordPress 3.1
     300 *
    281301 * @return string The gallery style filter, with the styles themselves removed.
    282302 */
     
    284304        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
    285305}
    286 add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
     306// Backwards compatibility with WordPress 3.0.
     307if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
     308        add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
    287309
    288310if ( ! function_exists( 'twentyten_comment' ) ) :
     
    309331                </div><!-- .comment-author .vcard -->
    310332                <?php if ( $comment->comment_approved == '0' ) : ?>
    311                         <em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
     333                        <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
    312334                        <br />
    313335                <?php endif; ?>
     
    333355        ?>
    334356        <li class="post pingback">
    335                 <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
     357                <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
    336358        <?php
    337359                        break;
     
    425447 * function tied to the widgets_init action hook.
    426448 *
     449 * This function uses a filter (show_recent_comments_widget_style) new in WordPress 3.1
     450 * to remove the default style. Using Twenty Ten 1.2 in WordPress 3.0 will show the styles,
     451 * but they won't have any effect on the widget in default Twenty Ten styling.
     452 *
    427453 * @since Twenty Ten 1.0
    428454 */
    429455function twentyten_remove_recent_comments_style() {
    430         global $wp_widget_factory;
    431         remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
     456        add_filter( 'show_recent_comments_widget_style', '__return_false' );
    432457}
    433458add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
     
    435460if ( ! function_exists( 'twentyten_posted_on' ) ) :
    436461/**
    437  * Prints HTML with meta information for the current postdate/time and author.
     462 * Prints HTML with meta information for the current post-date/time and author.
    438463 *
    439464 * @since Twenty Ten 1.0
Note: See TracChangeset for help on using the changeset viewer.