Filter hook 'dashboard_recent_drafts_query_args'

in WP Core File wp-admin/includes/dashboard.php at line 641

View Source

dashboard_recent_drafts_query_args

Filter Hook
Description
Filters the post query arguments for the 'Recent Drafts' dashboard widget.

Hook Information

File Location wp-admin/includes/dashboard.php View on GitHub
Hook Type Filter
Line Number 641

Hook Parameters

Type Name Description
array $query_args The query arguments for the 'Recent Drafts' dashboard widget.

Usage Examples

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

function my_custom_filter($query_args) {
    // Your custom filtering logic here
    return $query_args;
}

Source Code Context

wp-admin/includes/dashboard.php:641 - How this hook is used in WordPress core
<?php
 636  		 *
 637  		 * @since 4.4.0
 638  		 *
 639  		 * @param array $query_args The query arguments for the 'Recent Drafts' dashboard widget.
 640  		 */
 641  		$query_args = apply_filters( 'dashboard_recent_drafts_query_args', $query_args );
 642  
 643  		$drafts = get_posts( $query_args );
 644  		if ( ! $drafts ) {
 645  			return;
 646  		}

PHP Documentation

<?php
/**
		 * Filters the post query arguments for the 'Recent Drafts' dashboard widget.
		 *
		 * @since 4.4.0
		 *
		 * @param array $query_args The query arguments for the 'Recent Drafts' dashboard widget.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/dashboard.php
Related Hooks

Related hooks will be displayed here in future updates.