Get post types inside the post type creation action hook
-
Hi,
This is related to the hook shared in this topic: https://www.ads-software.com/support/topic/action-hook-for-post-type-creation/When i call get_post_type_object() or get_post_types() inside this hook, it is always returning NULL even post types are available. Is there any workaround for this.
Note: When I call it inside a different hook, it can get post types/post type objects properly.
function do_some_actions($data) { // I need to call get_post_type_object but this is always returning NULL $parent_post_type_object = get_post_type_object($parent_post_type); // Also when getting all post types, this is also returning NULL $custom_post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects'); } add_action( 'cptui_after_update_post_type', 'do_some_actions' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get post types inside the post type creation action hook’ is closed to new replies.