Title: hacking wp_insert_post
Last modified: August 19, 2016

---

# hacking wp_insert_post

 *  Resolved [pudde](https://wordpress.org/support/users/pudde/)
 * (@pudde)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/hacking-wp_insert_post/)
 * hiya,
 * i’ve installed my fair share of wordpress sites now and need to install wpmu 
   for a client. so far all seem ok, but i need to post stuff to the client’s main
   site when a blog post is published.
 * i can easily hack a function which send a http post (via curl or something) when
   triggered. but how can i trigger this without hacking the wp-admin wp_insert_post
   function? can i do this with do_action? if so – how?
 * all suggestions welcome. i’ve found nothing on the www…

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 5 months ago](https://wordpress.org/support/topic/hacking-wp_insert_post/#post-884090)
 * Hook to the publish_post action.
 *     ```
       add_action('publish_post','your_function');
       function your_function($post_id) {
       // do whatever here, post_id will be passed in to you
       }
       ```
   
 * Also, mu specific questions should go here:
    [http://mu.wordpress.org/forums/](http://mu.wordpress.org/forums/)
 *  Thread Starter [pudde](https://wordpress.org/support/users/pudde/)
 * (@pudde)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/hacking-wp_insert_post/#post-884094)
 * thank you, that’s _exact_ what i need! marvelous!
    (sorry for posting in the 
   wrong place)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘hacking wp_insert_post’ is closed to new replies.

## Tags

 * [do_action()](https://wordpress.org/support/topic-tag/do_action/)
 * [wp_insert_post](https://wordpress.org/support/topic-tag/wp_insert_post/)

 * 2 replies
 * 2 participants
 * Last reply from: [pudde](https://wordpress.org/support/users/pudde/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/hacking-wp_insert_post/#post-884094)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
