• I already posted the request on this github ; I thought is was the official repo. https://github.com/debtcollective/wp-webhooks-pro/issues/1

    Hello there,

    When I click on “Send Demo” ; it would be great if the data from the last Post were sent ; instead of Dummy Data ;

    I wrote a little code that does just that, let me know if I can open a PR.

    It’s just a simple code that I wrote quickly ; we’ll need to improve it a bit before we can merge ; but you get the idea.

    Could you integrate this in your plugin ?

    <?php
    // core/includes/integrations/wordpress/triggers/post_create.php
    
    public function get_demo( $options = array() ) {
        $post = get_post(get_posts("post_type=post&numberposts=1&fields=ids")[0]);
    
        return [
            'post_id' => $post->ID,
            'post' => $post,
            'post_meta' => get_post_meta($post->ID),
            'post_thumbnail' => get_the_post_thumbnail_url($post, 'full'),
            'post_permalink' => get_permalink($post),
            'taxonomies' => wp_get_object_terms( $post->ID, 'category', [ 'fields' => 'slugs' ] ),
        ];
    }
  • The topic ‘Use Last Post for the Send Demo instead of Dummy Data’ is closed to new replies.