Submit page changes for reviewer in beaver builder – wordpress

Published On: 10 October 2016.By .
  • Digital Engineering

beaver-builder-logo1

How we can submit page changes for review and make live after reviewed it in beaver builder?

There is  revisionary plugin https://wordpress.org/plugins/revisionary/.  Revisionary creates a new user role named Revisor. Revisors can make changes to page content, but they do not have the ability to Publish these changes, they can only “Submit for Review” before the changes can be published by an admin.

When using the default WordPress page as a Revisor role, the “Publish Changes” button changes to “Submit for Review”. However, when using the Page Builder to edit page content, the button seems it is generated separately, and the Revisor is able to Publish the changes.

When reviser user update any page and click on publish changes then page status being changed from publish to pending review which is wrong. It should create page revision and current page should work fine. After admin can check review and make new revision as published.

I found the code save_layout function where it update the post status to pending. So i changed it based on user role and it works fine now. Admin can check revision of post.

In wp-content/themes/bb-theme/functions.php file, you have to override method. You need to add this code to make a revision and load previous version.

add_action(“fl_builder_after_save_layout”, “bb_save_post_revision”);

When revisor submit changes then convert revision to page as pending state. After admin publish page then convert page again to revision and restore latest revision to parent page.

also bb-plugin/includes/ui-js-config.php file, You have to change text of button Publish Changes based on user role.

Above changes you need to add separately so you can get update from future versions.

Use below code to redirect to parent page.

 

Related content

That’s all for this blog

Go to Top