Where is the right place to register/enqueue scripts & styles

Why registering and queuing properly matters it should be in time – earlier than script/style is up for being output to page, otherwise it is too late; it should be conditional – otherwise you are loading stuff where you don’t need it and cause performance and functionality issues, for this you need WP environment loaded … Read more

Is there a save_post hook for custom post types?

the hook is the same save_post just make sure its your post type ex: add_action(‘save_post’,’save_post_callback’); function save_post_callback($post_id){ global $post; if ($post->post_type != ‘MY_CUSTOM_POST_TYPE_NAME’){ return; } //if you get here then it’s your post type so do your thing…. }

Where can I find a list of WordPress hooks?

@Arlen: As Keith S points out Adam Brown’s List of Hooks is the defacto resource of hooks for WordPress. However, it’s not perfect: It doesn’t show the hooks in order of when they are called, It doesn’t provide file name or line number where invoked, It doesn’t provide a number of arguments passed, It’s not … Read more

How to get WordPress’ hooks/actions run sequence?

“Data! Data! Data!” he cried impatiently. “I can’t make bricks without clay.” Sherlock Holmes – The Adventure of the Copper Beeches So let’s gather some real data from a vanilla WordPress 5.7.2 install and the TwentyTwelve theme activated with only a single Text widget. For the home page, the following do_action / do_action_ref_array calls are … Read more