rockschtar / wordpress-metarevisions
Library for use with roots/bedrock based WordPress projects. Enables meta-data revisions.
Installs: 2 522
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:wordpress-muplugin
Requires
- php: >=7.1
Requires (Dev)
- brain/monkey: ^2.2
- phpunit/phpunit: 7.5.*
README
Description
WordPress Must Use Plugin. Enables meta-data revisions via simplified hooks/filters for usage with composer based based WordPress projects (roots/bedrock or johnpbloch/wordpress).
Requirements
- PHP 7.1+
- Composer to install
Install
composer require rockschtar/wordpress-metarevisions
License
rockschtar/wordpress-metarevisions is open source and released under MIT license. See LICENSE.md file for more info.
Usage
This library allows you to store changes in post meta fields to the built in WordPress Revision Management System.
MetaRevisions::init();
add_filter('rswpmr_revision_meta_fields', function($fields) {
$fields['your_post_type_name']['your_post_meta_field'] = __('Your Meta Field Title');
return $fields;
});
add_filter('rswpmr_revision_meta_fields_callbacks', function($field_callbacks) {
$field_callbacks[] = array('field' => 'your_post_meta_field', 'callback' => function($value, $field) {
//option to convert your post meta value to a readable value
return $value;
});
return $field_callbacks;
});
Question? Issues?
rockschtar/wordpress-metarevisions is hosted on GitHub. Feel free to open issues there for suggestions, questions and real issues.