2017 © Pedro Peláez
 

library voce-post-meta

Easily create post metaboxes and add fields

image

voceconnect/voce-post-meta

Easily create post metaboxes and add fields

  • Monday, June 22, 2015
  • by voceconnect
  • Repository
  • 17 Watchers
  • 5 Stars
  • 14,359 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 16 Versions
  • 2 % Grown

The README.md

Voce Post Meta

Contributors: prettyboymp, kevinlangleyjr, jeffstieler, markparolisi, banderon
Tags: post, meta
Requires at least: 3.5
Tested up to: 4.2.2
Stable tag: 1.9.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html, (*1)

Description

Create a group (metabox), then add fields to it., (*2)

Installation

As standard plugin:

See Installing Plugins., (*3)

As theme or plugin dependency:

After dropping the plugin into the containing theme or plugin, add the following:, (*4)

if( ! class_exists( 'Voce_Meta_API' ) ) {
    require_once( $path_to_voce_post_meta . '/voce-post-meta.php' );
}

Usage

Example

<?php
add_action('init', function(){
    add_metadata_group( 'demo_meta', 'Page Options', array(
        'capability' => 'edit_posts'
    ));
    add_metadata_field( 'demo_meta', 'demo_key', 'Title', 'text', array(
        'description' => 'Descriptive string. Example: <code>Description</code>'
    ) );
    add_post_type_support( 'page', 'demo_meta' );
});
?>

Input Types

By default, Voce Post Meta comes with support for these input types:, (*5)

Text Inputs

  • text - A one line text input field.
  • textarea - A basic multiline text field.
  • numberic - The same as text field but sanitizes as a number on save.
  • wp_editor - Uses the full WordPress post content editor, for more advanced editing scenarios.

Selection

  • dropdown - A dropdown select field.
  • radio - Radio button selection field.
  • checkbox - Checkbox input field for on/off toggling.

The dropdown and radio fields expect an options argument passed into the options array. The options should be an array of $value => $label pairs., (*6)

This field is optional for the checkbox field; utilizing it will allow for multiple checkboxes under the same field and will cause the value to save as an array., (*7)

Additionally, for radio fields and checkbox fields that use the options argument, an item_container argument is available to specify the HTML tag used to wrap the individual items. The only currently allowed values are div (default) and span., (*8)

Misc

  • hidden A hidden input field for saving meta outside of user control.

Standard Field Options

These are the optional args that all default fields accept, and that any extended fields are expected to handle., (*9)

<?php
array(
    'description' => '', // A short description of the expected value displayed with the field.
    'default_value' => '', // The value to be shown and used when not set.

    // Override options
    'capability' => '', // User permission level that must be met to edit the field. Defaults to edit_posts
    'display_callbacks' => array(), // An array of valid callable functions to render the field display.
    'sanitize_callbacks' => array() // An array of callable functions to sanitize the field value on save.
);
?>

Changelog

Please refer to the full changelog at https://github.com/voceconnect/voce-post-meta/releases, (*10)

The Versions

22/06 2015

dev-master

9999999-dev

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Sean McCafferty
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

22/06 2015

1.9.2

1.9.2.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Sean McCafferty
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

11/06 2015

1.9.1

1.9.1.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Sean McCafferty
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

11/06 2015

1.9

1.9.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Sean McCafferty
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

02/04 2015

1.8.0

1.8.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

16/12 2014

dev-ver_2

dev-ver_2

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

16/12 2014

dev-ver_2-master

dev-ver_2-master

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

01/10 2014

1.7.0

1.7.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

02/09 2014

1.6.0

1.6.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

05/08 2014

1.5.1

1.5.1.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Kevin Langley Jr

wordpress post meta

18/04 2014

v1.5.0

1.5.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Mike Pretty
by Kevin Langley Jr

wordpress post meta

03/01 2014

dev-adding_sanitize_url

dev-adding_sanitize_url

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Michael Pretty
by Mike Pretty
by Kevin Langley Jr

wordpress post meta

02/01 2014

v1.4.2

1.4.2.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Mike Pretty
by Kevin Langley Jr

wordpress post meta

16/12 2013

v1.4.1

1.4.1.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Mike Pretty
by Kevin Langley Jr

wordpress post meta

21/11 2013

v1.4.0

1.4.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Mike Pretty
by Kevin Langley Jr

wordpress post meta

31/10 2013

v1.3.0

1.3.0.0

Easily create post metaboxes and add fields

  Sources   Download

GPLv2+

by Jeff Stieler
by Mark Parolisi
by Gary Smirny
by Mike Pretty
by Kevin Langley Jr

wordpress post meta