Code Monkey home page Code Monkey logo

wp-revision-manager's Introduction

# CF Revision Manager

The CF Revision Manager will take registered post meta fields and version them when post-revisions are made. The post-meta is duplicated and attached to the specific post-revision that is made. Registered post meta items will appear in the post-revision inspection screen. Post meta items do not show up in the post-comparison feature.

## Registering Your Post Meta

The CFR plugin includes a registration function to easily include your post-meta in the revision scheme.

	function my_registered_post_meta_item() {
		if (function_exists('cfr_register_metadata')) {
			cfr_register_metadata('my_metadata_key');
		}
	}
	add_action('init', 'my_registered_post_meta_item');
	
## Prettifying Your Post Meta

By default the post meta is run through `print_r` (if its an object or array) and then through `htmlspecialchars`. Register a callback function along with your post meta key to override the default display of your post meta in the revision screen.

	function my_registered_post_meta_item() {
		if (function_exists('cfr_register_metadata')) {
			cfr_register_metadata('my_metadata_key', 'prettify_my_postmeta');
		}
	}
	add_action('init', 'my_registered_post_meta_item');
	
	function prettify_my_postmeta($postmeta) {
		// make the post meta data presentable
		
		return $postmeta;
	}

wp-revision-manager's People

Contributors

iuliacazan avatar alexkingorg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.