widget_links_args

Filters the arguments for the Links widget.

Description

apply_filters( 'widget_links_args', (array) $widget_links_args, (array) $instance ); 

Parameters (2)

0. $widget_links_args (array)
An array of arguments to retrieve the links list.
1. $instance (array)
The settings for the particular instance of the widget.

Usage

To run the hook, copy the example below.
  1. $widget_links_args = apply_filters( 'widget_links_args', $widget_links_args, $instance ); 
  2.  
  3. if ( !empty( $widget_links_args ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the widget_links_args callback 
  2. function filter_widget_links_args( $widget_links_args, $instance ) { 
  3. // make filter magic happen here... 
  4. return $widget_links_args
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'widget_links_args', 'filter_widget_links_args', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'widget_links_args', 'filter_widget_links_args', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/widgets/class-wp-widget-links.php  
  1. wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );