• Hi, can you please help with issue:

    I had a code based on action add_action( 'wp_insert_post', 'broadcast_wp_insert_post', 10, 2 ); where another plugin been triggered while post been created by Zapier (Legacy WordPress Integration).

    Right now it is not working – tags are not passed to post while created by Zapier, can you please specify what changed in new method:

    function broadcast_wp_insert_post( $post_id, $post )
    			{
    				/**
    					@brief        Check for this taxonomy and broadcast to SHT.COM
    					@since        2018-10-27 15:36:08
    				**/
    				$taxonomy = 'post_tag';
    
    				/**
    					@brief        Check for this taxonomy term.
    					@since        2018-10-27 15:36:26
    					@since			2020-10-13 00:36:26
    					@$term = 'ifttted'; > $term_id = '63'; AND in line 961 if ( ! has_term( $term_id, $taxonomy, $post ) )
    				**/
    				$term = 'ifttted';
    
    				/**
    					@brief        Broadcast the post to these blogs if the tax+term exists.
    					@since        2018-10-27 15:36:44
    				**/
    				$blogs = [ 3 ];
    
    				if ( ! function_exists( 'ThreeWP_Broadcast' ) )
    					return;
    				
    				 // Post must have a specific category.
                    if ( ! has_term( $term, $taxonomy, $post ) )
                        return ThreeWP_Broadcast()->debug( 'On wp_insert_post: post %s does not have term %s', $post->ID, $term );
    
    				// Return an instance of broadcast.
    				$bc = ThreeWP_Broadcast();
    
    				// Don't broadcast if we are already broadcasting.
    				if ( $bc->is_broadcasting() )
    					return;
    
    				$bc->api()->broadcast_children( $post_id, $blogs );
    			}
    		add_action( 'wp_insert_post', 'broadcast_wp_insert_post', 10, 4 );
  • The topic ‘Zapier post_create not triggered in WordPress’ is closed to new replies.