• Resolved Justin Korn

    (@themonko)


    Hey Edward,

    Is there a way in any of your actions to get the child post object BEFORE it is modified?

    I’m currently doing the following in before_restore_current_blog:

    $data = $action->broadcasting_data;
    $child_post = get_post($data->modified_post->ID);

    But it seems at this point the $child_post object already reflects the changes made from the broadcast. I’ve tried the above within modify_post as well, but same thing.

    Any pointers would be greatly appreciated.

    Thanks!

    https://www.ads-software.com/plugins/threewp-broadcast/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author edward_plainview

    (@edward_plainview)

    How about broadcasting_after_switch_to_blog ?

    Thread Starter Justin Korn

    (@themonko)

    Seems like $data->modified_post isn’t available yet. Where would I get the child post id from?

    Plugin Author edward_plainview

    (@edward_plainview)

    $data->new_post() or $data->new_post( ‘ID’ )

    Thread Starter Justin Korn

    (@themonko)

    Thanks for the quick replies, Edward. Unfortunately, neither of those work.

    When using $data->new_post(); the name field (aka the slug) seems to be the slug from the parent page not the child page.

    When using $data->new_post('ID'); the I’m just getting 0 returned.

    But, that did lead me to find $data->broadcast_data->get_linked_child_on_this_blog() which is what I needed. Let me know if there is anything wrong with this, otherwise, thanks for the help!

    Plugin Author edward_plainview

    (@edward_plainview)

    Seems to be solved now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get and/or Protect the child permalink’ is closed to new replies.