register_post_type
function should be executed every time a WP request is made. Default post types don’t have this requirement. You can use your code as is, in MU plugin. Just create a .PHP
file with this code, and place it in mu-plugins
sub-folder of wp-content
. You don’t need to provide any standard plugin headers.
Related Posts:
- WordPress custom post action hook
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Types plugin custom post add_action hooks
- Where to put my code: plugin or functions.php?
- Should I use custom post types or a custom database tables for plugin development?
- How to enqueue scripts on custom post add/edit pages?
- remove custom post type permalink
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- How do I change the author of a custom post type?
- Custom Post Type Plugin: Where Do I Put The Template?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- How to Add Custom Taxonomy To Woocommerce Plugin
- Using add_theme_support inside a plugin
- Creating a Custom Post Type as a Plugin? Why?
- Quick edit screen customization
- Mini-Site Strategy
- The Great Plugin Nomenclature Contest of 2011
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- How to change “Draft” string for status of custom post type to “Unavailable”?
- How to completely disable a taxonomy archive on the frontend?
- How do you create an archive for a custom post type from a plugin?
- Action hook on Edit custom post type?
- Unregister post type from child theme
- Custom post type save_post action not firing
- How to correctly get post type in a the_title filter
- How to add a button to custom post type’s posts-page
- How to intercept publish post for a custom post type “event”
- Loading custom page template via plugin
- How to set a fall back template for a custom post type in a plugin?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How to add multiple images to custom post type?
- Creating a custom public user page
- How to show more posts on an archive page?
- wordpress plugin error handling
- How to get term link that crosses different custom post types?
- register_taxonomy with multiple object type and update_count_callback
- Redirect after deleting post and keep track of pagination
- How often do you need to register_post_type?
- get_edit_post_link() not working as expected when passed id in plugin
- Where to put archive-{post-type}.php
- Render a different post/template from within the template_include action?
- Is flush_rewrite_rules necessary when creating a custom post type? Why?
- How to use a dedicated template for the Custom Post Type from a plugin?
- How do I Make a custom post type get a custom post template in a plugin
- With what hook can I address all posts from all custom post types when they are published?
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!
- Determine which template-{slug}.php is being loaded
- WordPress Custom Shortcode Conflicting with Media Library
- How to append text to title of Custom Post Type post (without affecting all titles on page)?
- Remove Slug from Custom Post Type results in 404
- WordPress metabox file upload in custom post [duplicate]
- working Custom Post Type and Widget code no longer works when moved from functions.php to plugin
- Unable to filter on field on edit.php page
- Multiple Permalinks for custom post type post
- action init hook and get_post_types
- On clicking on the category name the page is redirecting on 404 pge
- Insert slider (Custom Post Type) into pages
- How do I create a custom post type for a training CMS in WordPress?
- WP Query group/order by category name
- Save or update data when custom post published
- Custom post type archive sorted and grouped by date in post meta field
- Remove POST_TYPE from custom post type permalink
- Uploaded image not appearing in custom post type
- Custom Taxonomy and tax_query Issue?
- What hook should be used to programmatically create a post only when master post is updated?
- pre get posts changing the query
- Use a textarea for a custom post type
- Using posts and postmeta table to store custom Address Book Plugin data
- Row actions not showing? Why?
- Make custom post type display as a page
- template_redirect not working, apparently for no reason
- How to: add option to add more checkboxes on custom post type
- Custom role capabilities to administrator not taking effect (no plugin)
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- How to add multiple featured image in meta box in post editor?
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- Hierarchical or Non-hierarchical Custom Post Type in Real World Example
- how to set default value for checkbox in wordpress
- How to append element after thumbnail
- Using pre_get_posts to Filter Posts
- How do I include drag-and-drop in a plugin?
- Remove “Get Shortlink” button in admin of custom post type
- update_post_meta() whenever custom post type is updated
- How could I create a ‘private comments’ section on a custom post type?
- How to get Custom Post ID by adding filter to child theme’s function
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- How do I set the link in the Custom Post Type admin menu?
- How to List Thumbnails based on Custom Categories
- Custom post_type search’s $wp_query->query_vars do not correspond
- Adding Meta Boxes while Registering a Post Type in a Class
- Check Title Unique Or Not and If not error message and dont save
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- How to rename image at uploading on specific plugin or post-type in WordPress
- handling csv data with a custom post type
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- Customize permalink when creating a post