wp-content/themes/twentyfourteen/inc/widgets.php:13Custom Widget for displaying specific post formats
Every hook that fires from inside Twenty_Fourteen_Ephemera_Widget, in the order it appears in the class, grouped by the method that fires it.
$formatsarrayprivateclass Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * The supported post formats. * * @since Twenty Fourteen 1.0 * * @var array */ private $formats = array( 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery' ); /** * Constructor. * * @since Twenty Fourteen 1.0 * * @return Twenty_Fourteen_Ephemera_Widget Widget instance. */ public function __construct() { parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( 'classname' => 'widget_twentyfourteen_ephemera', 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), 'customize_selective_refresh' => true, ) ); if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); } } /** * Enqueues scripts. * * @since Twenty Fourteen 1.7 */ public function enqueue_scripts() { /** This filter is documented in wp-includes/media.php */ $audio_library = apply_filters( 'wp_audio_shortcode_library', 'mediaelement' ); /** This filter is documented in wp-includes/media.php */ $video_library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' ); if ( in_array( 'mediaelement', array( $video_library, $audio_library ), true ) ) { wp_enqueue_style( 'wp-mediaelement' ); wp_enqueue_script( 'mediaelement-vimeo' ); wp_enqueue_script( 'wp-mediaelement' ); } } /** * Outputs the HTML for this widget. * * @since Twenty Fourteen 1.0 * * @global int $content_width Content width. * @global int $more * * @param array $args An array of standard parameters for widgets in this theme. * @param array $instance An array of settings for this widget instance. */ public function widget( $args, $instance ) { $format = isset( $instance['format'] ) ? $instance['format'] : ''; if ( ! $format || ! in_array( $format, $this->formats, true ) ) { $format = 'aside'; } switch ( $format ) { case 'image': $format_string = __( 'Images', 'twentyfourteen' ); $format_string_more = __( 'More images', 'twentyfourteen' ); break; case 'video': $format_string = __( 'Videos', 'twentyfourteen' ); $format_string_more = __( 'More videos', 'twentyfourteen' ); break; case 'audio': $format_string = __( 'Audio', 'twentyfourteen' );Introduced in Twenty Fourteen 1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-content/themes/twentyfourteen/inc/widgets.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.