Work with Revisionize plugin
-
I’m the dev for Revisionize. Is there a
filteroractionI 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 9 years, 7 months ago by
jamiechong.
-
This topic was modified 9 years, 7 months ago by
-
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@voltronik I create a new draft post for the revision. It’s a clone of the original post, but the
post_statusis 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_statushook and check for when the new_status==publish. However, I may use a different hook in the future. Likepublish_post.If you had the functionality for other plugin developers to register “custom notifications” with a
filterand then allow us to trigger the notification withdo_action. That should work.-
This reply was modified 9 years, 7 months ago by
jamiechong.
-
This reply was modified 9 years, 7 months ago by
jamiechong.
Hi @jamiechong,
Thanks for this – that’s really helpful.Let me take a look and I’ll get back to you.
Thanks,
JackHey @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
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,
JackHi @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
@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 likeadd_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 thenadd_actionfor 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 9 years, 6 months ago by
jamiechong.
-
This reply was modified 9 years, 6 months ago by
jamiechong.
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.
JackHi @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 -
This reply was modified 9 years, 7 months ago by
The topic ‘Work with Revisionize plugin’ is closed to new replies.