humanmade/wp-post-meta-revisions

Name: wp-post-meta-revisions

Owner: Human Made

Description: plugin for https://core.trac.wordpress.org/ticket/20564

Forked from: adamsilverstein/wp-post-meta-revisions

Created: 2017-06-27 22:28:36.0

Updated: 2017-06-27 22:28:38.0

Pushed: 2017-07-26 22:14:09.0

Homepage: null

Size: 476

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

=== WP-Post-Meta-Revisions ===

Allow selected post meta keys to be tracked in revisions.

== Description ==

This plugin implements a post meta revisioning feature as arrived at in https://core.trac.wordpress.org/ticket/20564.

The goal of releasing this code as a plugin is to allow as many people as possible to easily test the post meta revisioning feature, and also hopefully move towards inclusion of the feature into core, following the Features as Plugins model.

Further development of the code for this plugin will continue on its GitHub repository. Pull requests welcome!

To use this plugin, you must be running WordPress 4.1 or newer, two hooks were added in 4.1 that are required for this implementation.

To revision a post meta, you add its key via a filter:

function add_meta_keys_to_revision( $keys ) {
    $keys[] = 'meta-key-to-revision';
    return $keys;
}
add_filter( 'wp_post_revision_meta_keys', 'add_meta_keys_to_revision' );

Features:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.