Ticket #26744: 26744.3.patch
File 26744.3.patch, 1.3 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentyfourteen/inc/featured-content.php
152 153 public static function get_featured_post_ids() { 153 154 // Return array of cached results if they exist. 154 155 $featured_ids = get_transient( 'featured_content_ids' ); 155 if ( ! empty( $featured_ids ) ) { 156 return array_map( 'absint', (array) $featured_ids ); 156 if ( false !== $featured_ids ) { 157 if ( !empty( $featured_ids ) ) { 158 return array_map( 'absint', (array) $featured_ids ); 159 } 160 else { 161 return self::get_sticky_posts(); 162 } 157 163 } 158 164 159 165 $settings = self::get_setting(); … … 178 184 ), 179 185 ) ); 180 186 181 // Return array with sticky posts if no Featured Content exists.182 if ( ! $featured ) {183 return self::get_sticky_posts();184 }185 186 187 // Ensure correct format before save/return. 187 188 $featured_ids = wp_list_pluck( (array) $featured, 'ID' ); 188 189 $featured_ids = array_map( 'absint', $featured_ids ); 189 190 190 191 set_transient( 'featured_content_ids', $featured_ids ); 191 192 193 // Return array with sticky posts if no Featured Content exists. 194 if ( ! $featured ) { 195 return self::get_sticky_posts(); 196 } 197 192 198 return $featured_ids; 193 199 }