Skip to content

Link builder arguments - 'wp_link_query_args' filter is ignored #31496

@designbuildtest

Description

@designbuildtest

Description

Using the classic editor, it's possible to exclude post types and taxonomies from appearing in the link builder using:

function my_custom_link_query( $query ){
$query['post_type'] = array( 'post', 'pages', 'snippets' );
return $query;
}
add_filter( 'wp_link_query_args', 'my_custom_link_query' );

Gutenberg does not appear to support this same level of filtering of link builder arguments. All post types and taxonomies are available as link options by default.

Expected behaviour

Feature parity with classic editor enabling the filtering of link builder arguments.

Actual behaviour

All post types and taxonomies are available, even when filters are applied via wp_link_query_args

Screenshots

wp_link_query_args

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions