Ticket #29127: 29127.twentyeleven.2.patch
File 29127.twentyeleven.2.patch, 14.7 KB (added by , 10 years ago) |
---|
-
wp-content/themes/twentyeleven/404.php
34 34 <?php 35 35 /* translators: %1$s: smilie */ 36 36 $archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'twentyeleven' ), convert_smilies( ':)' ) ) . '</p>'; 37 the_widget( 'WP_Widget_Archives', array( 'count' => 0 , 'dropdown' => 1 ), array( 'after_title' => '</h2>'.$archive_content ) );37 the_widget( 'WP_Widget_Archives', array( 'count' => 0, 'dropdown' => 1 ), array( 'after_title' => '</h2>' . $archive_content ) ); 38 38 ?> 39 39 40 40 <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?> -
wp-content/themes/twentyeleven/author.php
26 26 ?> 27 27 28 28 <header class="page-header"> 29 <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID") ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>29 <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1> 30 30 </header> 31 31 32 32 <?php -
wp-content/themes/twentyeleven/content-image.php
20 20 21 21 <?php if ( comments_open() && ! post_password_required() ) : ?> 22 22 <div class="comments-link"> 23 <?php comments_popup_link( '<span class="leave-reply">' . __( "Reply", 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>23 <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> 24 24 </div> 25 25 <?php endif; ?> 26 26 </header><!-- .entry-header --> -
wp-content/themes/twentyeleven/functions.php
332 332 <?php 333 333 $color = get_header_textcolor(); 334 334 $image = get_header_image(); 335 $style = 'display: none;'; 335 336 if ( $color && $color != 'blank' ) 336 $style = ' style="color:#' . $color . '"'; 337 else 338 $style = ' style="display:none"'; 337 $style = 'color: #' . $color . ';'; 339 338 ?> 340 <h1 class="displaying-header-text"><a id="name" <?php echo $style; ?>onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>341 <div id="desc" class="displaying-header-text" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>339 <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1> 340 <div id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></div> 342 341 <?php if ( $image ) : ?> 343 342 <img src="<?php echo esc_url( $image ); ?>" alt="" /> 344 343 <?php endif; ?> … … 443 442 'name' => __( 'Main Sidebar', 'twentyeleven' ), 444 443 'id' => 'sidebar-1', 445 444 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 446 'after_widget' => "</aside>",445 'after_widget' => '</aside>', 447 446 'before_title' => '<h3 class="widget-title">', 448 447 'after_title' => '</h3>', 449 448 ) ); … … 453 452 'id' => 'sidebar-2', 454 453 'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ), 455 454 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 456 'after_widget' => "</aside>",455 'after_widget' => '</aside>', 457 456 'before_title' => '<h3 class="widget-title">', 458 457 'after_title' => '</h3>', 459 458 ) ); … … 463 462 'id' => 'sidebar-3', 464 463 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ), 465 464 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 466 'after_widget' => "</aside>",465 'after_widget' => '</aside>', 467 466 'before_title' => '<h3 class="widget-title">', 468 467 'after_title' => '</h3>', 469 468 ) ); … … 473 472 'id' => 'sidebar-4', 474 473 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ), 475 474 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 476 'after_widget' => "</aside>",475 'after_widget' => '</aside>', 477 476 'before_title' => '<h3 class="widget-title">', 478 477 'after_title' => '</h3>', 479 478 ) ); … … 483 482 'id' => 'sidebar-5', 484 483 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ), 485 484 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 486 'after_widget' => "</aside>",485 'after_widget' => '</aside>', 487 486 'before_title' => '<h3 class="widget-title">', 488 487 'after_title' => '</h3>', 489 488 ) ); … … 578 577 } 579 578 580 579 if ( $class ) 581 echo 'class="' . $class. '"';580 echo 'class="' . esc_attr( $class ) . '"'; 582 581 } 583 582 584 583 if ( ! function_exists( 'twentyeleven_comment' ) ) : … … 714 713 if ( function_exists( 'get_post_galleries' ) ) { 715 714 $galleries = get_post_galleries( get_the_ID(), false ); 716 715 if ( isset( $galleries[0]['ids'] ) ) 717 716 $images = explode( ',', $galleries[0]['ids'] ); 718 717 } else { 719 718 $pattern = get_shortcode_regex(); 720 719 preg_match( "/$pattern/s", get_the_content(), $match ); -
wp-content/themes/twentyeleven/header.php
40 40 41 41 // Add a page number if necessary: 42 42 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) 43 echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page) );43 echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) ); 44 44 45 45 ?></title> 46 46 <link rel="profile" href="http://gmpg.org/xfn/11" /> … … 111 111 $header_image_height = HEADER_IMAGE_HEIGHT; 112 112 } 113 113 ?> 114 <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />114 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="" /> 115 115 <?php endif; // end check for featured image or standard header ?> 116 116 </a> 117 117 <?php endif; // end check for removed header image ?> -
wp-content/themes/twentyeleven/image.php
66 66 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 67 67 else 68 68 // or get the URL of the first image attachment 69 $next_attachment_url = get_attachment_link( $attachments[ 0]->ID );69 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 70 70 } else { 71 71 // or, if there's only 1 image, get the URL of the image 72 72 $next_attachment_url = wp_get_attachment_url(); -
wp-content/themes/twentyeleven/inc/theme-options.php
218 218 ); 219 219 220 220 if ( is_rtl() ) 221 221 $default_theme_options['theme_layout'] = 'sidebar-content'; 222 222 223 223 /** 224 224 * Filter the Twenty Eleven default options. … … 277 277 <input type="hidden" id="default-color-<?php echo esc_attr( $scheme['value'] ); ?>" value="<?php echo esc_attr( $scheme['default_link_color'] ); ?>" /> 278 278 <span> 279 279 <img src="<?php echo esc_url( $scheme['thumbnail'] ); ?>" width="136" height="122" alt="" /> 280 <?php echo $scheme['label']; ?>280 <?php echo esc_html( $scheme['label'] ); ?> 281 281 </span> 282 282 </label> 283 283 </div> … … 316 316 <input type="radio" name="twentyeleven_theme_options[theme_layout]" value="<?php echo esc_attr( $layout['value'] ); ?>" <?php checked( $options['theme_layout'], $layout['value'] ); ?> /> 317 317 <span> 318 318 <img src="<?php echo esc_url( $layout['thumbnail'] ); ?>" width="136" height="122" alt="" /> 319 <?php echo $layout['label']; ?>319 <?php echo esc_html( $layout['label'] ); ?> 320 320 </span> 321 321 </label> 322 322 </div> … … 562 562 $layouts = twentyeleven_layouts(); 563 563 $choices = array(); 564 564 foreach ( $layouts as $layout ) { 565 $choices[ $layout['value']] = $layout['label'];565 $choices[ $layout['value'] ] = $layout['label']; 566 566 } 567 567 568 568 $wp_customize->add_control( 'twentyeleven_theme_options[theme_layout]', array( -
wp-content/themes/twentyeleven/inc/widgets.php
22 22 $this->WP_Widget( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), $widget_ops ); 23 23 $this->alt_option_name = 'widget_twentyeleven_ephemera'; 24 24 25 add_action( 'save_post', array( &$this, 'flush_widget_cache' ) );26 add_action( 'deleted_post', array( &$this, 'flush_widget_cache' ) );27 add_action( 'switch_theme', array( &$this, 'flush_widget_cache' ) );25 add_action( 'save_post', array( &$this, 'flush_widget_cache' ) ); 26 add_action( 'deleted_post', array( &$this, 'flush_widget_cache' ) ); 27 add_action( 'switch_theme', array( &$this, 'flush_widget_cache' ) ); 28 28 } 29 29 30 30 /** … … 38 38 function widget( $args, $instance ) { 39 39 $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); 40 40 41 if ( ! is_array( $cache ) )41 if ( ! is_array( $cache ) ) 42 42 $cache = array(); 43 43 44 44 if ( ! isset( $args['widget_id'] ) ) 45 45 $args['widget_id'] = null; 46 46 47 if ( isset( $cache[ $args['widget_id']] ) ) {48 echo $cache[ $args['widget_id']];47 if ( isset( $cache[ $args['widget_id'] ] ) ) { 48 echo $cache[ $args['widget_id'] ]; 49 49 return; 50 50 } 51 51 52 52 ob_start(); 53 extract( $args, EXTR_SKIP );54 53 55 54 /** This filter is documented in wp-includes/default-widgets.php */ 56 $ title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base);55 $args['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base ); 57 56 58 57 if ( ! isset( $instance['number'] ) ) 59 58 $instance['number'] = '10'; 60 59 61 if ( ! $ number= absint( $instance['number'] ) )62 $number= 10;60 if ( ! $args['number'] = absint( $instance['number'] ) ) 61 $args['number'] = 10; 63 62 64 63 $ephemera_args = array( 65 'order' => 'DESC',66 'posts_per_page' => $ number,67 'no_found_rows' => true,68 'post_status' => 'publish',69 'post__not_in' => get_option( 'sticky_posts' ),70 'tax_query' => array(64 'order' => 'DESC', 65 'posts_per_page' => $args['number'], 66 'no_found_rows' => true, 67 'post_status' => 'publish', 68 'post__not_in' => get_option( 'sticky_posts' ), 69 'tax_query' => array( 71 70 array( 72 71 'taxonomy' => 'post_format', 73 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-status', 'post-format-quote' ),74 'field' => 'slug',72 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-status', 'post-format-quote' ), 73 'field' => 'slug', 75 74 'operator' => 'IN', 76 75 ), 77 76 ), … … 79 78 $ephemera = new WP_Query( $ephemera_args ); 80 79 81 80 if ( $ephemera->have_posts() ) : 82 echo $ before_widget;83 echo $ before_title;84 echo $ title; // Can set this with a widget option, or omit altogether85 echo $a fter_title;81 echo $args['before_widget']; 82 echo $args['before_title']; 83 echo $args['title']; 84 echo $args['after_title']; 86 85 ?> 87 86 <ol> 88 87 <?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?> … … 111 110 </ol> 112 111 <?php 113 112 114 echo $a fter_widget;113 echo $args['after_widget']; 115 114 116 115 // Reset the post globals as this query will have stomped on it 117 116 wp_reset_postdata(); … … 119 118 // end check for ephemeral posts 120 119 endif; 121 120 122 $cache[ $args['widget_id']] = ob_get_flush();121 $cache[ $args['widget_id'] ] = ob_get_flush(); 123 122 wp_cache_set( 'widget_twentyeleven_ephemera', $cache, 'widget' ); 124 123 } 125 124 -
wp-content/themes/twentyeleven/showcase.php
105 105 } 106 106 ?> 107 107 108 <section class="featured-post <?php echo $feature_class; ?>" id="featured-post-<?php echo $counter_slider; ?>">108 <section class="featured-post <?php echo esc_attr( $feature_class ); ?>" id="featured-post-<?php echo esc_attr( $counter_slider ); ?>"> 109 109 110 110 <?php 111 111 /* … … 135 135 <?php 136 136 137 137 // Reset the counter so that we end up with matching elements 138 138 $counter_slider = 0; 139 139 140 140 // Begin from zero 141 141 rewind_posts(); 142 142 143 143 // Let's roll again. 144 145 144 while ( $featured->have_posts() ) : $featured->the_post(); 145 $counter_slider++; 146 146 if ( 1 == $counter_slider ) 147 $class = ' class="active"';147 $class = ' class="active"'; 148 148 else 149 149 $class = ''; 150 151 <li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php echo esc_attr( sprintf( __( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>"<?php echo $class; ?>></a></li>150 ?> 151 <li><a href="#featured-post-<?php echo esc_attr( $counter_slider ); ?>" title="<?php echo esc_attr( sprintf( __( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>"<?php echo $class; ?>></a></li> 152 152 <?php endwhile; ?> 153 153 </ul> 154 154 </nav>