Is it possible to “deactivate” a custom post type and then later if you feel like using it again you can simple “activate” it again?
1 comment
Comments are closed.
Is it possible to “deactivate” a custom post type and then later if you feel like using it again you can simple “activate” it again?
Comments are closed.
Yes, custom post types are registered on the fly, on every request. So you can create an option, say
active_custom_post_types
and check for that before you register the post type.Pseudo-code: