• Resolved jamiechong

    (@jamiechong)


    I’m the dev for Revisionize. Is there a filter or action I can apply that will allow me to trigger a notification when a Revision is created? If not, how can we collaborate to make these two plugins work together?

    I’m trying to support this this use case here.

    Thanks!

    • This topic was modified 8 years, 5 months ago by jamiechong.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @jamiechong,
    Thanks for getting in touch about this – would love to work together with you to get this working.

    What post status transitions are you using when creating a revision? BNFW mostly works on the basis of draft to publish but other post status transitions are setup as notifications too.

    Let me know.

    Thanks,
    Jack

    Thread Starter jamiechong

    (@jamiechong)

    @voltronik I create a new draft post for the revision. It’s a clone of the original post, but the post_status is draft. It would be great to trigger a notification on this event.

    Secondarily, when the revision is published (either user clicks Publish, or cron job publishes it because it’s Scheduled), I use the transition_post_status hook and check for when the new_status==publish. However, I may use a different hook in the future. Like publish_post.

    If you had the functionality for other plugin developers to register “custom notifications” with a filter and then allow us to trigger the notification with do_action. That should work.

    • This reply was modified 8 years, 4 months ago by jamiechong.
    • This reply was modified 8 years, 4 months ago by jamiechong.
    Plugin Author bnfw

    (@voltronik)

    Hi @jamiechong,
    Thanks for this – that’s really helpful.

    Let me take a look and I’ll get back to you.

    Thanks,
    Jack

    Thread Starter jamiechong

    (@jamiechong)

    Hey @voltronik – just checking in to see if you’ve given this any more consideration. Let me know if there’s more I can do to help!

    Jamie

    Plugin Author bnfw

    (@voltronik)

    Hi @jamiechong,
    The roadmap and features for the next release, including investigating this, is currently being worked on. Any questions, I’ll let you know.

    Thanks,
    Jack

    Plugin Author bnfw

    (@voltronik)

    Hi @jamiechong,
    Been looking into this.

    It would appear that it might not be possible to trigger a notification for Revisionize because it is not a custom post type. You’re creating a duplicate of a post and saving it as a draft, right?

    Jack

    Thread Starter jamiechong

    (@jamiechong)

    @voltronik
    You have that correct, I don’t use custom post types. In fact it’s possible to Revisionize any custom post type. So the post gets duplicated and the post_status is draft.

    My naive approach would be BNFW to let me add_filter – something like

    
    add_filter('bnfw-custom-notifications', function($notifications) {
      $notifications['revisionize_new_revision_created'] = array(
        'label' => 'Revisionize: Created',
        'description' => '...',
        'other_settings_you_need' => '...'
      );
    });
    

    The above would show my custom notification in the BNFW admin panel and allow users to configure who gets notified just like your built-in events. For you to set this up, you would need to $custom_notifications = apply_filters('bnfw-custom-notification', array()) and then add_action for the ones returned. Like this:

    
    foreach ($custom_notifications as $key=>$val) {
      // Set up the your admin UI based on settings in $val
      
      // listen for when I trigger the custom action
      add_action($key /*revisionize_new_revision_created*/, 'handle_custom_notification');
      
    }
    function handle_custom_notification($args) {
        // you need to tell me the $args you need here
        // and then fire off the notification
    }
    

    I would trigger the event with do_action,

    
    // need to know the $args you need
    do_action('revisionize_new_revision_created', $arg1, $arg2, $etc)
    

    This does open the door for other devs to extend your plugin. I recognize you’ve monetized it and this may allow devs to write their own “pro” features that compete with your own.

    What do you think? If you’re not interested in taking this further, no problem, but please let me know. Thanks!!

    • This reply was modified 8 years, 4 months ago by jamiechong.
    • This reply was modified 8 years, 4 months ago by jamiechong.
    Plugin Author bnfw

    (@voltronik)

    Hi @jamiechong,
    Thanks for looking into this in some detail.

    You’re right in that additions such as this would need to be in the form of add-ons to BNFW.
    I’m investigating how I can go about doing this moving forward at the moment but might be a little while.

    Thanks.
    Jack

    Plugin Author bnfw

    (@voltronik)

    Hi @jamiechong,
    Just re-visiting this.

    In order for a Revisionize BNFW integration to work, you’d have to hook into multiple hooks:
    * One to display the notification in the dropdown.
    * One to trigger the email.
    * One to process the notification.
    * One to display the notification name.
    * Etc.

    I am investigating opening this up to other developers and I suppose it’s already possible however, I’m concentrating on adding features to both the core plugin and producing / improving add-ons at the moment so it’s not particularly high on the roadmap but it is on there and something I’ll hopefully get around to in due course.

    Hope this helps a bit.

    Thanks,
    Jack

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Work with Revisionize plugin’ is closed to new replies.