Filter hook 'widget_links_args'

in WP Core File wp-includes/widgets/class-wp-widget-links.php at line 80

View Source

widget_links_args

Filter Hook
Description
Filters the arguments for the Links widget.

Hook Information

File Location wp-includes/widgets/class-wp-widget-links.php View on GitHub
Hook Type Filter
Line Number 80

Hook Parameters

Type Name Description
array $widget_links_args An array of arguments to retrieve the links list.
array $instance The settings for the particular instance of the widget.

Usage Examples

Basic Usage
<?php
// Hook into widget_links_args
add_filter('widget_links_args', 'my_custom_filter', 10, 2);

function my_custom_filter($widget_links_args, $instance) {
    // Your custom filtering logic here
    return $widget_links_args;
}

Source Code Context

wp-includes/widgets/class-wp-widget-links.php:80 - How this hook is used in WordPress core
<?php
  75  		 * @see wp_list_bookmarks()
  76  		 *
  77  		 * @param array $widget_links_args An array of arguments to retrieve the links list.
  78  		 * @param array $instance          The settings for the particular instance of the widget.
  79  		 */
  80  		wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );
  81  	}
  82  
  83  	/**
  84  	 * Handles updating settings for the current Links widget instance.
  85  	 *

PHP Documentation

<?php
/**
		 * Filters the arguments for the Links widget.
		 *
		 * @since 2.6.0
		 * @since 4.4.0 Added the `$instance` parameter.
		 *
		 * @see wp_list_bookmarks()
		 *
		 * @param array $widget_links_args An array of arguments to retrieve the links list.
		 * @param array $instance          The settings for the particular instance of the widget.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/widgets/class-wp-widget-links.php
Related Hooks

Related hooks will be displayed here in future updates.