In a plugin that I’m developing I’d like to be able to display a list of all custom post types currently enabled. Is there any way to detect where a post type has been initiated? For example, if it was created by a plugin, is there a way to detect that and then report the plugin or file where it was initiated?
1 comment
Comments are closed.
Hook into
registered_post_type
and store the data fromdebug_backtrace()
. The third entry should be the calling plugin.Sample code
Sample output