get_header and hook avoid normal call

No, you cannot do that, unfortunately, because get_header( $name ) doesn’t have a filter for the $name (it only passes the name with the action call). However, if you are willing to modify the header.php file for each site with something like this right at the beginning of the file: <?php if ( apply_filters( ‘load_custom_header’, … Read more

Action hook on only publishing post not on editing or updating

You have to use new_to_publish action as described on Post Status Transitions Codex page (updated according @prog comment): add_action( ‘new_to_publish’, ‘pms_post_published_notification’, 10, 1 ); function pms_post_published_notification( $post ) { if( ‘property’ === $post->post_type ) { // custom code here } } The only argument is passed to your function is $post object, so you can … Read more

Remove action added through function

Found the answer here: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623 <?php function child_remove_parent_function() { remove_action( ‘woocommerce_before_main_content’, ‘mod_output_content_wrapper’, 10 ); } add_action( ‘wp_loaded’, ‘child_remove_parent_function’ ); ?> Explanation is in the link.

Pass parameters to function through an action

add_action() and add_filter() take 4 params: string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1. So, the function you are hooking to takes more than 1 param, then just pass the number of params it accepts as the 4th param to add_action(). In your case, add_action (‘my_action’, ‘my_function’, 10, 2) ;