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
- How to call a custom post with get_posts() instead of query_posts()?
- WordPress Custom Post Type is Matching on Partial Slug
- WordPress search: pretty URLs (permalinks), custom post types and pagination
- Create user role restricted to specific CPT
- Best Way to Leverage Custom Post Type Related Content and Consider SEO
- List taxonomies with thumbnails
- Only Show an Author Their Custom Post Types
- How to customize the Categories meta box to allow only one category?
- Querying CPT with Two Taxonomies
- Get Custom Field Values by Another Custom Field in WordPress
- Wp Rest API request posts from a custom taxonomy
- Disable single view in register_post_type [duplicate]
- Getting a thumbnail for an external video as the thumbnail for a custom post type?
- How to: CRUD for custom post types in the front end?
- How is this CPT code in functions.php adding a hidden “products” category?
- Displaying Multiple Post types in Taxonomy
- Insert post metadata for all posts in CPT at once if metadata no existent
- How to alter WP-JSON main query or best practise for custom endpoints
- Function to display custom post type on front page makes menu items dissapear
- Display Recently Added Custom Post Types with Custom Taxonomy Shortcode
- How do I display tags for a custom post type single page?
- Illegal offset type in get_post_type_object()?
- Dynamic dropdown select values depending on other custom field value
- Query Custom Post Type Taxonomy term with multiple parameters
- Post format alternative?
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Load scripts based on post type
- Filter get_cat_id for Custom Post Type
- Why is my WP Query not returning first result’s post meta?
- Custom Permalinks with meta value not working. Why?
- How can I use this code on a custom database table?
- Custom post types and ‘new WP_Query’
- Query Custom Post Types with checkboxes
- How To Get Custom Post Type Category Title
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Rewrite custom post type with taxonomy
- how to count the current posts terms
- Create Custom Post type that uses Page.php template
- Add custom post type taxonomy tag to article class
- highlight parent page menu item when in custom post type
- Combine 2 different custom post slugs into a single permalink?
- Metaboxes inside Tab
- How to hide bottom navigation (previous/next post) in Custom Post Type plugin in WordPress?
- WP_Query: how to search tags in addition to a custom post type?
- WordPress URL rewrites using Advanced Custom Field
- How to display custom post type taxonomy in Contact Form 7 text field
- Custom Post Type & Taxonomies – Rewrite
- Custom post type author issues
- Custom Taxonomy Page
- Do not show child pages within a file page
- How to prepend text to custom field value A, but only if custom field value B matches a certain string?
- Custom Taxonomy is disabled on Edit page
- Creating multiple CPT posts from one Gravity form
- disabel for custom post Auto Upload Images
- Function not pulling image or text from custom post type
- Need an idea about how to open a popup which contain only post created form in wordpress admin
- Sorting custom post types by taxonomy (So close)
- Return Custom Post Type Categories
- Associating post id with its post type
- Types plugin isn’t compatible with my custom post type
- Show Posts in Vertical Tabs with Scrollbar
- MF2 and qTranslate problem with custom post types post titles [closed]
- How do I filter a custom post type loop by a field?
- How to order different custom post type in category or tag template page?
- ACF Relationship: Group posts by parent category term, then child [closed]
- Custom Post Type urls not working
- Just the First Metabox what saves the data!