-
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Last updated for version 1.2
You can use these filters inside your theme functions.php file or in a plugin.
Allows you to change the HTML element for the subtitle.
Since: 1.0
Default: span
@since 1.0.0
@since 1.1.0 Add extra parameters.
@since 1.1.3 Add WP_Widget instance parameter.
@param string 'span' The HTML element.
@param string $widget_id The widget ID (widget name + instance number).
@param string $sidebar_id The sidebar ID where this widget is located.
@param array $widget All widget data.
@param \WP_Widget $widget_obj The Widget object.
@return string A valid HTML element.
Allow filter for subtitle classes to overwrite, remove or add classes.
Since: 1.0
Default: array( 'widget-subtitle', 'widgetsubtitle', 'subtitle-{LOCATION}' );
Where {LOCATION} stands for your selected location.
@since 1.0.0
@since 1.1.0 Add extra parameters.
@since 1.1.3 Add WP_Widget instance parameter.
@param array $subtitle_classes The default classes.
@param string $widget_id The widget ID (widget name + instance number).
@param string $sidebar_id The sidebar ID where this widget is located.
@param array $widget All widget data.
@param \WP_Widget $widget_obj The Widget object.
@return array An array of CSS classes.
Sets the default location for subtitles.
Since: 1.1.2
Default: after-inside
@since 1.1.2
@param string $subtitle_location The subtitle location (default: 'after-inside').
@return string Options: 'after-inside', 'after-outside', 'before-inside', 'before-outside'.
Change the capability required to modify subtitle locations.
Since: 1.1.2
Default: edit_theme_options
@since 1.1.2
@param string $location_cap The capability.
@return string
Overwrites the available locations for a widget.
NOTE: Location keys must be strings!
Since: 1.1.3
Default: array( 'after-inside', 'after-outside', 'before-inside', 'before-outside' )
@since 1.1.3
@since 1.2.0 Allow custom location + add `$widget_id` and `$sidebar_id` parameters.
@param string[] $locations The array of available locations.
@param \WP_Widget $widget_obj The widget object.
@param array $instance The widget instance.
@param string $widget_id The widget ID (widget name + instance number).
@param string $sidebar_id The sidebar ID where this widget is located.
@return string[] $locations The available locations: key => label.
Add subtitle at a custom location.
Since: 1.2
Default: array( 'after-inside', 'after-outside', 'before-inside', 'before-outside' )
@since 1.2.0
@param array $params Widget sidebar parameters from `dynamic_sidebar_params` filter.
@param string $subtitle The subtitle.
@param string $subtitle_location The selected subtitle location.
@param \WP_Widget $widget_obj The widget object.
@param string $sidebar_id The sidebar ID where this widget is located.
@return array
Filters the widget subtitle.
Since: 1.2
@since 1.2.0
@param string $subtitle The widget subtitle.
@param array $instance Array of settings for the current widget.
@param string $widget_id The widget ID (widget name + instance number).
@param string $sidebar_id The sidebar ID where this widget is located.
@param array $widget All widget data.
@param \WP_Widget $widget_obj The Widget object.
@return string The new subtitle.