• Hi there,

    Love the plugin, great job. I made a small customisation to suit my needs and thought you might like to include it in a future version. For example if the post already existed on the destination blog I wanted to maintain the post_status (draft etc) in order to allow a very basic level of moderation.

    Line 437 I changed from
    $p = wp_insert_post( $post );
    to
    $p = wp_insert_post( apply_filters('sitewide_tags_post_insert', $post) );

    Keep up the good work.

    https://www.ads-software.com/extend/plugins/wordpress-mu-sitewide-tags/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bobbydonovan

    (@bobbydonovan)

    Forgot to add, the other half of that example above is the function below, just in case someone wants it.

    add_action('sitewide_tags_post_insert', 'custom_save_publish_state');
    function custom_save_publish_state($post) {
        if ($post->ID) {
            $existing_post = get_post($post->ID);
            $post->post_status = $existing_post->post_status;
        }
        return $post;
    }

    Can you help, I want to insert post only which in selected category.

    I tried to modify
    $p = wp_insert_post( $post );

    in to

    if (in_array(“mycategory”, $cats){

    $p = wp_insert_post( $post );
    …..
    }

    not working

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WordPress MU Sitewide Tags Pages] Hook on post insert’ is closed to new replies.