Changeset 26577
- Timestamp:
- 12/03/2013 06:46:02 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php
r26556 r26577 76 76 */ 77 77 public function widget( $args, $instance ) { 78 // If called directly, assign an unique index for caching.79 if ( -1 == $this->number ) {80 static $num = -1;81 $this->_set( --$num );82 }83 84 $content = get_transient( $this->id );85 86 if ( false !== $content ) {87 echo $content;88 return;89 }90 91 ob_start();92 extract( $args, EXTR_SKIP );93 94 78 $format = $instance['format']; 95 79 $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); … … 116 100 $GLOBALS['content_width'] = 306; 117 101 118 echo $ before_widget;102 echo $args['before_widget']; 119 103 ?> 120 104 <h1 class="widget-title <?php echo esc_attr( $format ); ?>"> … … 210 194 <?php 211 195 212 echo $a fter_widget;196 echo $args['after_widget']; 213 197 214 198 // Reset the post globals as this query will have stomped on it. … … 218 202 219 203 endif; // End check for ephemeral posts. 220 221 set_transient( $this->id, ob_get_flush() );222 204 } 223 205
Note: See TracChangeset
for help on using the changeset viewer.