Old question but I found an answer at Here by Simon Hampel at the bottom. Cool filter, but I coulnd’t find a whole lot of documentation on it so I’m not 100% sure everything it’s connected to. One thing I do know is it’s used to pull the links on ‘Link to existing content’. Put this in your functions.php
file:
function custom_wp_link_query_args($query)
{
$pt_new = array();
$exclude_types = array('exclude_post_types_here');
foreach ($query['post_type'] as $pt)
{
if (in_array($pt, $exclude_types)) continue;
$pt_new[] = $pt;
}
$query['post_type'] = $pt_new;
return $query;
}
add_filter('wp_link_query_args', 'custom_wp_link_query_args');
Related Posts:
- Is there a way to get N number of WYSIWYG editors in a custom post type?
- Is it possible to remove WYSIWYG for a certain Custom Post Type?
- Adding content to archive and taxonomy pages on custom post types?
- What is the use of the wp_links table?
- Building a Digg clone using WordPress?
- Removing custom post type from link search results
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Website bookmarks as a custom post type
- Get_post_meta() won’t return value
- How do I display custom post types through a common taxonomy?
- Related links – from other sites
- Adding multiple WYSIWYG editors to custom post type
- Add TinyMCE to CPT metaboxes in 3.1?
- Delete link on single-custom.php with redirection
- Linking to the most recent post in a Custom Post Type
- Link to full size post thumbnail
- wysiwyg editor don´t export paragraph
- Linking to Post Types from wp-admin
- Plain links in single-class.php and archive-class.php not working
- Highlight current post type when inside custom post type
- Adding link to dashboard sidebar, nested under custom post type
- WYSIWYG on custom meta boxes while disabling main editor?
- Publish box in CPT remove ‘edit’ link
- Problem to get the link of the default ‘post’ post type like the orther custom types
- How can I generate a list of post-type specific categories?
- Post Custom & Taxonomy 404 error
- Why the custom post type links don’t work if not login?
- PHP Button Custom link [closed]
- Possible to limit internal link search to post types with Gutenberg editor?
- Custom post type Premalinks main page and details page
- Change CPT Edit Target Link for Admin List
- Replace the custom post type permalink
- How to change permalink structure off default posts and also CPT’s posts
- Meta data (Tags and Categories) for Custom Posts not showing.
- Front end access to a SQL data repository – recommended way?
- Custom Meta fields Update hook?
- How to display custom field value on page?
- Displaying custom post types in front end
- Navigate posts with different post type that are in the same categories
- Custom taxonomy (categories) on custom post type return no results
- Page listing Custom Posts
- post_per_page ignored in WP_Query
- the_title not working
- Display different information of a custom post type
- Custom taxonomy wp_query woes.
- WordPress app page not found error for posts with hyphen in permalink
- Where is the sticky post option?
- get_the_tag_list() returns bad links
- Add term list as class
- Filter second dropdown (tax) based on first dropdown (cpt)
- Dump custom post type database
- uploading problem of wordpress theme
- Excluding a Custom Post Type with a specific tag using pre_get_posts
- Custom Post Type Link added to menu won’t show in frontend
- show all custom posts types in home page
- List of users that clicked a ‘Join’ button at single post
- Taxonomy archive 404ing (not term archive)
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Display an authors post on a single page only when they are logged in
- How to group navigation items in the admin panel
- Hide meta box for everything BUT a certain custom post type
- Include php on a specific page template
- Create Array from custom post type to display a slider
- what custom post type this archive belongs to?
- Setting Post Title via Meta Data returns Auto-draft
- Tags not working in my custom post type
- Custom post-type metabox position
- wp_trash_post action hook with custom post type
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- What’s an efficient way to change the post status of many posts at once?
- Use Pages for Custom Post Type
- Return the name of the post type
- I can’t access custom taxonomy page listing
- Is it possible to load a different sidebar in single.php based on a meta_query filter?
- How to have permalink like domain.com/term/postname?
- List Posts By Custom Taxonomy
- Can variables be used to rewrite a Custom Post Type permalink? [duplicate]
- Creating two loops based on different logic
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Filter posts by tax (dropdown) and meta value
- How do I amend form data before it is saved for a custom post type
- Archive-posttype.php isn’t loaded
- List of all entries of custom-post-type: Add year-parameter?
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Custom Posts values in custom post overview
- Should I use custom taxonomies or not?
- delete_post_meta() for whole CPT / multiple posts?
- List of child custom post types lists all custom post types
- get comments by current user inside page template
- Move Genesis Single Page/Single Post Title
- Get Specific Template Part if Custom Field is Some Value
- How can Custom Post Type and a page have the same slug?
- Custom filter for main search: how to exclude specific post_type from search results
- Page as Archive page
- Is This Code Efficient – Or is there a better way?
- get post types and plugin order
- Confused about Custom Post Types