• If you are using PublishPress revisions then you might find that you don’t get anything on the Update or Create webhooks.

    And if you do, you get something with a weird permalink with just numbers on the end like this http://www.website.com?p=30207

    If you look into this ID it doesn’t exist. That’s because it was the revision ID and when you published the contents was moved to your original ID.

    If you want to get posts updated via PublishPress Revisions from WP Webhooks you can add this to your functions.php and use the Custom trigger called webhook.

    Update “$webhook_names” with the name(s) of the Custom trigger called webhook you create

    add_action( 'revision_applied', 'revision_webook', 10, 1 );
    
    function revision_webook($publishedID) {
    
    $custom_data = array(
    
    'title' => get_the_title($publishedID),
    
    'permalink' => get_permalink($publishedID)
    
    );
    
    $webhook_names = array(
    
    'revision-applied'
    
    );
    
    $http_args = array(
    
    'blocking' => true //Set this to true to receive the response
    
    );
    
    $response = apply_filters( 'wp_webhooks_send_to_webhook_filter', array(), $custom_data, $webhook_names, $http_args );
    
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Wp Webhook & PublishPress Revisions’ is closed to new replies.