Open pbiron opened 7 years ago
wp_insert_post() will happily insert a post whose post_type
is not registered.
A related issue has to do with importing terms whose taxonomy
is not registered. Unlike wp_insert_post()
, wp_insert_term() will NOT insert a term whose taxonomy
is not registered.
So, maybe posts with an unregistered post_type
should not be imported? Or maybe wp_insert_post()
should be changed to not insert such posts (to match the behavior of wp_insert_term()
? Or maybe wp_insert_term()
should be changed to allow inserting terms whose taxonomy
is not registered (to match the behavior of wp_insert_post()
?
Confusing :-(
The standard importer (and the import redux plugin this is forked from) refuse to import a post if it's
post_type
is not registered.My thoughts are that such posts should be imported...but that the user should be
warned
about the unregistered post type (so that they can decide whether to install/activate the plugin/theme from the exporting site that registered that post type).Seeking feedback on this topic: should we import such posts?