Now compatible with PHP≥5.2!
One of the greatest features of WordPress is the
Customizer which allows you to change settings and preview them in real-time, all before you publish them for everyone to see. (Go ahead and click that big
Customize Your Site button on your Dashboard!) But what if you make a change and want to go back in time to restore your previous settings? Changes to posts can be previewed (
mostly), and they have revisions which allow you to revert the current version to restore a previous one.
The same revision system is needed for settings. This is what the Settings Revisions plugin implements.
In the Customizer, a new section appears at the top called “Settings Revision” and inside of it appears a dropdown of all revisions in the system, showing when they were made, who made them, and what changes were made. A text field appears below which allows users to supply a commit message.
Once installed, also check out the
Widget Customizer plugin which brings sidebars and widget form controls into the Customizer, allowing you to edit widgets and preview them just like you do for any other settings in the Customizer. With the Settings Revisions and Widget Customizer plugins combined, you get
widget revisions. Also try Settings Revisions with the
Styles plugin.
You can access the Customizer by clicking the “Customize Your Site” button on your Dashboard, by accessing the
Appearance > Customize menu item in the admin, or on the front-end of your site by clicking the “Customize” sub-menu item in the admin bar. You can also install the
Customizer Everywhere plugin which makes the Customizer more accessible and integrates it with post previewing.
Development of this plugin is done on GitHub. Pull requests welcome. Please see issues reported there before going to the plugin forum.
0.3
- Remove ability to add new revision posts in admin. Fixes (#30). Props kucrut.
- Only update a non-scalar setting's value if it has not changed according to
_.isEqual
. Props westonruter.
- Serialize all values (even strings) when saving settings; this ensures storing non-scalar values, like arrays containing numbers, do not get these values converted into strings. Props westonruter.
- Add a
temp_customize_sanitize_js
filter so that other plugins can have a chance to run serialization for the output JS-value (used by Widget Customizer); a more robust solution is needed, as noted in the inline comments. Props westonruter.
0.2
- Eliminate PHP 5.3 requirement by removing namespaces and closures (#22)
- Fix PHP_CodeSniffer issues according to the WordPress Coding Standards (#17), add to Travis and
pre-commit
- Add jshint to Travis and
pre-commit
hook (#17)
- Improve pre-commit hook to optionally scan modified files
0.1.3
Fix handling of settings which contain PHP-serialized values; use
customize_controls_enqueue_scripts
action.
0.1.2
Correct method for updating customizer, by updating settings not by updating controls.
0.1.1
Eliminate strict standards notice
Fix customizer control
0.1.0
First Release