wppaste
WordPress

Twenty_Eleven_Ephemera_Widget

Since
Twenty Eleven 1.0
Source
wp-content/themes/twentyeleven/inc/widgets.php:13
Widget For displaying post format posts

Description

Handles displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven.

Compatibility

WordPress
since Twenty Eleven 1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 1

Every hook that fires from inside Twenty_Eleven_Ephemera_Widget, in the order it appears in the class, grouped by the method that fires it.

Methods · 6

Source code

class Twenty_Eleven_Ephemera_Widget extends WP_Widget { 	/**	 * PHP5 constructor.	 *	 * @since Twenty Eleven 2.2	 */	public function __construct() {		parent::__construct(			'widget_twentyeleven_ephemera',			__( 'Twenty Eleven Ephemera', 'twentyeleven' ),			array(				'classname'                   => 'widget_twentyeleven_ephemera',				'description'                 => __( 'Use this widget to list your recent Aside, Status, Quote, and Link posts', 'twentyeleven' ),				'customize_selective_refresh' => true,			)		);		$this->alt_option_name = 'widget_twentyeleven_ephemera'; 		add_action( 'save_post', array( &$this, 'flush_widget_cache' ) );		add_action( 'deleted_post', array( &$this, 'flush_widget_cache' ) );		add_action( 'switch_theme', array( &$this, 'flush_widget_cache' ) );	} 	/**	 * PHP4 constructor.	 *	 * @since Twenty Eleven 1.0	 * @deprecated Twenty Eleven 2.2	 */	public function Twenty_Eleven_Ephemera_Widget() {		self::__construct();	} 	/**	 * Outputs the HTML for this widget.	 *	 * @since Twenty Eleven 1.0	 *	 * @param array                     $args     An array of standard parameters for widgets in this theme.	 * @param array<string, string|int> $instance An array of settings for this widget instance.	 */	public function widget( $args, $instance ) {		$cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); 		if ( ! is_array( $cache ) ) {			$cache = array();		} 		if ( ! isset( $args['widget_id'] ) ) {			$args['widget_id'] = null;		} 		if ( ! is_customize_preview() && isset( $cache[ $args['widget_id'] ] ) ) {			echo $cache[ $args['widget_id'] ];			return;		} 		ob_start(); 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */		$args['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base ); 		if ( ! isset( $instance['number'] ) ) {			$instance['number'] = '10';		} 		$args['number'] = absint( $instance['number'] );		if ( ! $args['number'] ) {			$args['number'] = 10;		} 		$ephemera_args = array(			'order'          => 'DESC',			'posts_per_page' => $args['number'],			'no_found_rows'  => true,			'post_status'    => 'publish',			'post__not_in'   => get_option( 'sticky_posts' ),			'tax_query'      => array(				array(

Changelog

Introduced in Twenty Eleven 1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-content/themes/twentyeleven/inc/widgets.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.