ThreeWP Broadcast
Broadcast from front-end (3 posts)

  1. isay
    Posted 3 years ago #

    I'm using your plugin and think it's great! I have a question for you…
    I'm allowing logged in users to create content from the front end. I would like these posts to be broadcasted as well. Is there a way I can programatically check the broadcast checkboxes ( Link this post to its children, Broadcast taxonomies also, Create taxonomies automatically, Broadcast custom fields) in my code, e.g. in a add_action('save_post'..) function?

    Best regards,


  2. edward mindreantre
    Posted 3 years ago #

    You want the options to be forced or defaults?

  3. isay
    Posted 3 years ago #

    I managed to figure this out...

    Basically I created a function which trigger on post save:

    add_action('save_post', array(&$this,'save_event'));
    function do_the_broadcast($post_id) {
    $_POST['post_type'] = 'event';
    $_POST['broadcast']['link'] = 'link';
    $_POST['broadcast']['taxonomies'] = 'taxonomies';
    $_POST['broadcast']['taxonomies_create'] = 'taxonomies_create';
    $_POST['broadcast']['custom_fields'] = 'custom_fields';
    $broadcast = new ThreeWP_Broadcast();
    remove_action('save_post', array(&$this,'save_event'));
    ..... //Do some updates to the post ....
    $broadcast->save_post( $post_id );
    add_action('save_post', array(&$this,'save_event'));

    Could I define which target blogs to broadcast to this way?
    E.g. if ($taxonomy == 'x') $_POST['broadcast']['blogs'] = array('blog1', 'blog2', '...'); else $_POST['broadcast']['blogs'] = array('blog3', 'blog4', '...');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic