Execute a function in target site after sync is done
-
I want to execute a function after a post is inserted/updated in the target site to assign new categories to all posts that have a category at source site.
I have tried with this hooks but don’t seem to work:
add_action('wp_insert_post', 'update_post_cats'); add_action('save_post','update_post_cats'); add_action('the_post', 'update_post_cats'); add_action('draft_to_publish', 'update_post_cats'); add_action('new_to_publish', 'update_post_cats'); add_action('pending_to_publish', 'update_post_cats'); add_action('future_to_publish', 'update_post_cats'); add_action('publish_post', 'update_post_cats'); add_action('post_updated', 'update_post_cats');
If I update an imported post in the target site it assigns ok the new category, but the main idea is to make this once the post is synchronized.
There’s some hook to make this or you know some way to achieve this?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Execute a function in target site after sync is done’ is closed to new replies.