Instead of having the users turn on and off the custom post types via a filter or action, you could have them select custom post types on an options page in the admin. When you have these selections in the database, your plugin can look at them at any point you need.
If you still want to use hooks in functions.php, you could set up a hook that would set the option in the database, instead of creating a new options page.
Related Posts:
- How to Add Custom Taxonomy To Woocommerce Plugin
- Development of a WordPress Search Plugin – Best Practices
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- post_type_link filter causes 404 on the CPT page it’s used on
- Getting arguments for register_post_type from a plugin generated post type
- update custom post type meta from a shortcode
- Query posts between two dates (custom meta keys) CMB2
- How to localize value of posts
- Used with meta_query in query_posts works slowly
- How to register custom post types in a plugin?
- Display custom taxonomy as dropdown list
- How to append element after thumbnail
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- Custom Post Type | Fatal Error on register_post_type()
- Set object terms not working on plugin activation
- GravityForm: Populate Dropdown with custom post type [closed]
- “add_post_type_support” with Custom Post Type & ACF
- Shortcode insertion in tab
- Add CPT as subpage under custom page
- WooCommerce product search titles only
- Update menu when saving settings
- custom post type not showing in menu
- If post has custom field then display css-class
- Adding a custom post type taxonomy template in plugin
- Replace text in post from cvs
- add category name to permalinks on product page /category-name/product-name
- How can I make a custom post type sticky?
- Broken featured images are uploading from frontend
- limit value taxonomy based on previous taxonomy value wordpress
- Tracking changes in admin-page so user gets warning when leaving the page
- How to change wp prefix for custom post type only?
- Metabox not show in categories custom post type cmb2
- custom post type and non-standard gallery
- How to change permalink to include custom post type
- How to Add multiple instance of meta box to custom post type
- Custom fields for custom post type
- Custom Post Archive is not working
- How to add multiple images to a custom post type without plugin [closed]
- How to create multiple editor?
- Add categories to a page with out using Custom Post Types
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- Create metaboxes based on custom post type
- How can I have different content for different countries?
- post_parent in custom post type
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Post URL based on Custom Post Types variables
- custom permalink for post only not custom post types
- Get image from external URL
- Getting only one post per category
- CMB2 metabox create select with list of post from CPT
- Update Post Status On Woocommerce Payment Complete
- Modify Posts from Custom_Post_Type within the plugin
- Create a simple Testimonial page
- Methods for development wordpress themes [closed]
- Custom pages missing on “front page” setting
- Overriding Plugin Function in Child Theme
- Custom post types, disable fields
- Send post changes to set email addresses (not users or subscribers)
- Types plugin custom post add_action hooks
- Accessing a protected property of a post
- Multiple archives to display parent and subcategories content
- Custom post type 404 error on “default” or “numeric” permalinks
- custom post type single page not found after aotumatic publish By the author’s robot
- Accessing download link from the loop with WP Download Manager Pro
- Custom Post Type works when registered in functions.php but not when registered in plugin
- Reading Custom Post data so I can have user update Manually
- How to show link to product in custom fields?
- Show Post columns to specific users on condition
- Add input radio menu to post
- Disable ‘Add New’ in custom post that is made from CPT UI
- CPT UI: Connect a custom post type to a custom post type
- Simple Data picker meta box
- How to check if a new private custom post type is created?
- Looping through image object using ACF and CPT UI [SOLVED]
- Create Inclusions and exclusions
- How to create groups like that in buddypress?
- Post that populates itself (almost) automatically using data from imported excel file
- I broke it! Custom post type archive gets redirected to home
- Custom Fields through plugin in a Custom Post Type
- Can’t save custom post type fields
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- How to Create movie schedule by custom post type query
- Adding CPT changes entire layout of my site except for the archive of that CPT
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- How to Fix WordPress 500 Internal server error due to custom post type
- Custom Fields as Post Type Options
- get_post_types doesn’t work in plugin
- Custom Post Type parent slug as menu item
- Customizing a plugin function using a hook
- Custom Info Box at end of posts?
- Extending a CPT by Created by another plugin
- How to add post type in masonry posts elementory widget
- Remove plugin’s custom post type archive page and single pages [closed]
- Display Custom Post Type on Toolset Types Plugin
- make playlist from a custom post type
- How to delete unnecessary custom post types in the UI
- add_filter > posts_where works partially
- Simple Share Buttons Add Plugin and Custom Post Type
- Retrieve a post with its ACF repeater fields in wordpress
- WP 4.4 upgrade custom post type cannot add new