widget_title
This filter is documented in wp-includes/widgets/class-wp-widget-pages.php.
Description
Parameters (3)
- 0. $instance_title
- The empty.
- 1. $instance (unknown)
- The instance.
- 2. $this_id_base (unknown)
- The this id base.
Usage
- To run the hook, copy the example below.
- $instance_title = apply_filters( 'widget_title', $instance_title, $instance, $this_id_base );
- if ( !empty( $instance_title ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the widget_title callback
- function filter_widget_title( $instance_title, $instance, $this_id_base ) {
- // make filter magic happen here...
- return $instance_title;
- };
- // add the filter
- add_filter( 'widget_title', 'filter_widget_title', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'widget_title', 'filter_widget_title', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /inc/widgets.php
- $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base);