WordPress.org

Make WordPress Core

Ticket #29374: 29374.1.diff

File 29374.1.diff, 700 bytes (added by danielbachhuber, 7 years ago)

Add query args filter for dashboard recent posts

  • wp-admin/includes/dashboard.php

     
    689689                'cache_results'  => false,
    690690                'perm'           => ( 'future' === $args['status'] ) ? 'editable' : 'readable',
    691691        );
     692        /**
     693         * Filter the query args used for the Recent Posts widget.
     694         *
     695         * @since 4.2.0
     696         *
     697         * @param array $query_args The arguments passed to WP_Query to produce the list of posts
     698         */
     699        $query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args );
    692700        $posts = new WP_Query( $query_args );
    693701
    694702        if ( $posts->have_posts() ) {