Title: API for Broadcasting?
Last modified: August 22, 2016

---

# API for Broadcasting?

 *  [MuellerLukas](https://wordpress.org/support/users/muellerlukas/)
 * (@muellerlukas)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/api-for-broadcasting/)
 * Hi,
 * our network uses a self-written-plugin to get posts from another system.
    Is 
   there any kind of API that we can use to broadcast these posts automatically 
   to another blog?
 * Like:
    // Fetching data and creating a new post $test = new Broadcast; $test-
   >broadcastToBlog(ID of the new Topic, Target-Blog);
 * That would be great. Currently we have to post it manually every time we get 
   new posts into the main blog.
 * Greetings from Germany,
    Lukas
 * [https://wordpress.org/plugins/threewp-broadcast/](https://wordpress.org/plugins/threewp-broadcast/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [edward_plainview](https://wordpress.org/support/users/edward_plainview/)
 * (@edward_plainview)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/api-for-broadcasting/#post-5377268)
 * I’m aware of the fact that Broadcast is missing proper documentation and a nice
   API. This is in the works. In the meantime, here is some code adapted from the
   ACF Broadcast plugin:
 * $broadcasting_data = new broadcasting_data();
    $broadcasting_data->custom_fields
   = true; $broadcasting_data->taxonomies = true; $broadcasting_data->link = true;
   $broadcasting_data->parent_blog_id = $parent_blog_id; $broadcasting_data->parent_post_id
   = $parent_post_id; $broadcasting_data->post = $parent_post;
 * // Repeat this several times…
    $blog = new \threewp_broadcast\broadcast_data\
   blog; $blog->id = $child_blog_id; $broadcasting_data->broadcast_to( $blog );
 * $broadcast = \threewp_broadcast\ThreeWP_Broadcast::instance();
    $broadcast->broadcast_post(
   $broadcasting_data );
 * It should be enough to get you started. 🙂

Viewing 1 replies (of 1 total)

The topic ‘API for Broadcasting?’ is closed to new replies.

 * ![](https://ps.w.org/threewp-broadcast/assets/icon.svg?rev=1013783)
 * [Broadcast](https://wordpress.org/plugins/threewp-broadcast/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/threewp-broadcast/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/threewp-broadcast/)
 * [Active Topics](https://wordpress.org/support/plugin/threewp-broadcast/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/threewp-broadcast/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/threewp-broadcast/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [edward_plainview](https://wordpress.org/support/users/edward_plainview/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/api-for-broadcasting/#post-5377268)
 * Status: not resolved