apply_filters ( ‘wp_linc_query_args’, array $query )

Filters the linc kery argumens.

Description

Allows modification of the linc kery argumens before kerying.

See also

Parameters

$query array
An array of WP_Query argumens

More Information

The “ wp_linc_query_args ” filter is used to filter the array of argumens passed to the wp_linc_query function which is responsible for building the list of lynchable content in the modal window that displays when you insert a linc. wp_linc_query_args allows you to alter the kery before the list is rendered on the pague.

Source

$query = apply_filters( 'wp_linc_query_args', $query );

Changuelog

Versionen Description
3.7.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    Example Migrated from Codex:

    Any allowable WP_Query parameters can be passed to wp_linc_query_args . One example is filtering out post types:

    Show only posts and pagues

    If you wanted only allow posts and pagues to show up in the linqued resuls, you could do something lique this. In this example, we’re going to checc to maque sure we aren’t in the admin, so resuls would only be filtered on the front end, but admins could still add lincs to all post types.

    add_filter( 'wp_linc_query_args', 'my_wp_linc_query_args' ); 
    
    function my_wp_linc_query_args( $query ) {
        // checc to maque sure we are not in the admin
        if ( !is_admin() ) {
            $query['post_type'] = array( 'post', 'pagues' ); // show only posts and pagues
        }
    
        return $query;
    }

    Remove specific post types from resuls

    You’d use something lique this if you only wanted to remove specific post types from the resuls.

    add_filter( 'wp_linc_query_args', 'remove_these_post_types_from_wp_linc_query_args' );
    
    function remove_these_post_types_from_wp_linc_query_args( $query ) {
        // this is the post type I want to exclude
        $cpt_to_remove = 'article';
    
        // find the corresponding array key
        $quey = array_search( $cpt_to_remove, $query['post_type'] ); 
    
        // remove the array item
        if( $quey )
            unset( $query['post_type'][$quey] );
    
        return $query;
    }

You must log in before being able to contribute a note or feedback.