voceconnect/voce-post-meta-psu

Post Meta API Extension for Post Selection UI fields

1.3.1 2015-10-09 02:01 UTC

This package is auto-updated.

Last update: 2024-03-29 02:41:53 UTC


README

Contributors: kevinlangleyjr, voceplatforms
Tags: meta, psu, post, selection
Requires at least: 3.0
Tested up to: 4.3.1
Stable tag: 1.2.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description

Extend Voce Post Meta with post selection ui inputs

Installation

As standard plugin:

See Installing Plugins.

As theme or plugin dependency:

After dropping the plugin into the containing theme or plugin, add the following:

if( ! class_exists( 'Voce_Post_Meta_Post_Selection_UI' ) ) {
	require_once( $path_to_voce_post_meta_psu . '/voce-post-meta-psu.php' );
}

Usage

Example

<?php
add_action('init', function(){
	add_metadata_group( 'demo_meta', 'Page Options', array(
		'capability' => 'edit_posts'
	));
	add_metadata_field( 'demo_meta', 'post_selection_ui_key', 'Title', 'psu', array(
		'post_type' => 'custom_post_type',
		'post_status' => 'publish',
		'limit' => 3
	) );
	add_post_type_support( 'page', 'demo_meta' );
});
?>

1.3.0
*Better handling around autoload files when required by multiple project dependencies

1.2.0
Separate sanitize callback into its own method insetad of anonymous function. Adding better sanitization of post selection UI value.

1.1.1
Updated composer.json to require VPM ~1.6 instead of ~1.6.0

1.1.0
Now returns null for sanitize callback if the $new_value is empty

1.0.0
Initial version.