Revise published content and add Workflow Support to revised content
Want to update published content WITHOUT taking the article offline?
Oasis Workflow has support for updating published content via workflow while keeping your current version of published content online.
You can revise an article, let the revised article flow through the workflow and finally when all the review is complete, Oasis Workflow will simply copy over the contents to the published article.
It not only copies the revised content, but also copies the various artifacts, like category changes, tag changes and all the post meta attributes to the revised article.
With Oasis Workflow Pro, it’s very simple to add workflow support for updating a published content while keeping your current content online.
Watch the video to see how it works.
Set your revision preferences
When you revise a post/page, you can set what the new title should look like. You can add a prefix or a suffix to easily identify a revision of an article.
Make revision
A new button will appear for all the published content. This button will essentially allow you to create a revision of the published article.
The plugin will copy most of the stuff out of the box, like content, metadata, attachments, taxonomies etc.
We also added a couple of hooks for you to extend the copy/make revision feature. You can use these hooks to copy other stuff from the article.
- owf_duplicate_post
- owf_duplicate_page
- owf_update_published_post
- owf_update_published_page
The revised item can now flow through the workflow in the same way as a normal article. However, we suggest to create a separate workflow (fast-track, smaller workflow), just so that updating a published article is faster. In other words, you may only need one-level review for updating published articles.
Publish a revised article
Now when you are about the published a revised article, the plugin will simply copy over the contents, attachments, taxonomies to the already published article from the revised article. While copying over the title it will strip off the prefix and the suffix from the revised article. It will also display a friendly message to indicate the copy action.
Moreover, the same hooks apply here too.
The “revised article” status is changed to “usedrev”, so that it’s not visible again. At the end, you are left with only one article (updated published article).
Other Features related to document revisioning
- “Make Revision” is available for “Scheduled” articles also.
- You can schedule a revision update – When you do the final sign off on a revised article, you can specify a date/time for this revision to update the original/published article.
- Handling hierarchical post types – You can now configure if you wish to revise children articles when the parent article is being revised.
- One Active Revision – The plugin will allow only one active revision for a given article.
You can now get the “Oasis Workflow Pro” from our site. What are you waiting for? Purchase a copy today!
22 comments on “Revise published content and add Workflow Support to revised content”
Comments are closed.
I have a question, if i use another plugin to create custom meta fields.
These fields was copied too ?
It depends. If the other plugin creates those meta fields in the same way wordpress does, the fields will get copied over. But if they store it in some other format/database table, then you need to use the hooks – http://www.oasisworkflow.com/hooks-and-filters to copy over the data.
Here is an example for “custom field suite plugin“. This plugin stores the meta information in a custom table, so we need to use the hook to copy over the data.
Here’s the hook/function which will do the trick in case of “custom field suite plugin”. This will be to copy the CFS data on the revised object.
Then after the revised post has gone through the workflow, you need to use the “owf_update_published_post” hook to copy over the CFS data again back to the published post
Hope this helps.
Thanks for your support. This is useful with me
Hi Ravi,
I’m using Workflow pro version and “custom field suite plugin“. use your example work fine with normal custom field (text, textarea …), but with custom field has type is “loop row”, it’s not work correctly. Please help me to fix it.
thanks.
Sure. let me look into it and will reply back asap.
The “loop row” worked for me with the above code.
I tested with a simple field in the loop though. What type of field are you putting in the loop?
Nevermind, I see the issue. It’s essentially copying the same value for all the loop fields.
Let me look into it.
Greate, I’m still waiting for good news 🙂
I’ll soon be releasing an update (1.0.4 version) that will have multiple fixes for this particular feature.
I’ll also release an updated code for the Custom Field Suite plugin, that will take care of copying over the “loop” attributes.
In order to make it more modular, I’ll also be releasing a couple of hooks for “updating the published content”.
There was a small regression in the “Make Revision” feature in 1.0.3. I’ll also add a fix for the same.
The 1.0.4 release is targeted for March 13th.
Stay tuned.
I have released a new version of Oasis Workflow Pro which has the fixes for “make revision” and “updating published content”. I have also added two additional hooks to support the above.
The above code to support Custom Fields Suite plugin (including the “loop” property) is also updated. We now need two functions to support the “make revision” and “update published content”. check out the above code and let me know.
Hi Ravi, I used 2 action hook and your code above but it not work:
//workflow
add_action(‘owf_duplicate_post’, array(__CLASS__, ‘copy_cfs_values’), 10, 2);
add_action(‘owf_duplicate_page’, array(__CLASS__, ‘copy_cfs_values’), 10, 2);
add_action(‘owf_update_published_post’, array(__CLASS__, ‘update_cfs_values’), 10, 2);
add_action(‘owf_update_published_page’, array(__CLASS__, ‘update_cfs_values’), 10, 2);
with old version, I still duplicate new post/page with custom field. After update to 1.0.4 and using your code, even not duplicate page/post custom field.
Please check it out, thanks
That’s very interesting. I tested with the same code and it worked.
Can you convert your function to a static function and see if that helps?
Do you see any errors in the PHP log?
BTW, I’m testing with Version 2.1.1 of Custom Fields Plugin and WordPress 3.8.1.
Are you using a different version?
Hi Ravi, I’ll check in your code and I see:
foreach ($post_meta_keys as $meta_key) {
$meta_key_trim = trim($meta_key);
if ( ‘_’ == $meta_key_trim{0} || strpos($meta_key_trim,’oasis’) !== false ) //ignore keys like _edit_last, _edit_lock
continue;
$meta_values = get_post_custom_values($meta_key, $post->ID);
foreach ($meta_values as $meta_value) {
$meta_value = maybe_unserialize($meta_value);
add_post_meta($new_id, $meta_key, $meta_value, false);
}
}
in file: wp-content/plugins/oasis-workflow-pro/includes/workflow-duplicate-post.php, LINE 190.
Because template page is stored in field has key “_wp_page_template”, so it was ingnored by your code.
I think your test case only cover “default template”, not using custom template for page :(.
Please check it.
Thanks
Did removing that underscore(_) check fix your issue? If so, I will fix the code and ignore specific keys.
Here’s the code you can put/replace for that condition check.
Make sure to put the same code in both copy_post_meta_info() and update_post_meta_info() functions
Hi Ravi, I used this code and it copy good, but I wonder what’s ignore keys remaining ?. I think it has many risk :-s.
Please re-check with custom template and file field in loop row (input type file)
thank you.
I’ll check with a custom template and let you know. BTW, did you try running the revision through the workflow and then updating the published content via workflow.
The new code should handle all Adds/Deletes/Modifications to the CFS fields done on the revised post/page.
Hi Ravi, your code have bug when I using duplicate key in loop row. Example, in loop row 1 I using key “thumbnail”, and I still using this key for loop row 2.
Please check it, thanks
I just tried using a loop attribute with file attachment and the key as “thumbnail” – See attached image..
Here’s how it looks in the database:
When I “make revision”, I get the same set of values on my revised item. Are you not seeing a similar behavior? Let me know. If needed, send me a support message to run some analysis on your site directly.
Hi Ravi, I found simple solution for this problem. I use cfs plugin API to copy/add custom field. Here is my code:
It works fine for me, please check it,
Thanks
Thanks for the code. I’ll look into it and let you know.