bainternet / My-Meta-Box

A class for creating custom meta boxes for WordPress
http://en.bainternet.info/2012/how-i-add-a-wordpress-metabox
GNU General Public License v3.0
225 stars 89 forks source link

My Wordpress Meta box Class

Contributors: bainternet Requires at least: 3.1 Tested up to: 3.7.1

Description

The Meta Box Class is used by including it in your plugin files and using its methods to create custom meta boxes for custom post types. It is meant to be very simple and straightforward. For name spacing purposes, All Types metabox ( meaning you can do anything with it ) is used.

This class is derived from Meta Box script by Rilwisrilwis@gmail.com version 3.2. which later was forked by Cory Crowley (email: cory.ivan@gmail.com) The purpose of this class is not to rewrite the script but to modify and change small things and adding a few field types that i needed to my personal preference. The original author did a great job in writing this class, so all props goes to him.

Usage

Take a look at the class-usage-demo.php file which can also be tested as a WordPress Plugin. Other options are available for each field which can be see in the 'my-meta-box-class.php' file,

Known Issues and Limitations

Reapater field can't handle Posts and Taxonomy for now (and maybe even others).

Changelog

= 3.1.1 =

= 3.1.0 =

= 3.0.6 = Fixed issue #74.

= 3.0.5 = Fixed issue #64

= 3.0.4 =
Fixed #52

= 3.0.3 =
Added html5 Number Field

= 3.0.2 = Fixed #48. Cleaned up Javascript file. Added Swedish translations thanks to #lolitaloco :)

= 3.0.1 = Better add_meta_box logic

= 3.0.0 = fixed issues #45 #42

= 2.9.9 = Cleaned up some comments in the code. Added a conditional fields block #37 ,as can be seen in demo plugin.

= 2.9.8 = Fixed field groupping #32 Added Select2 #31 Added WordPress 3.5 color picker support. better field type checking algo.

= 2.9.7 = Added class attribute to most fields. #33 Added Style attribute to most fields. #33 fixed Language Mo issue. improved has_filed logic for better performance.

= 2.9.6 = Fixed file upload issue #22

= 2.9.5 = Typo.

= 2.9.4 = Added localization support.

= 2.9.3 = Fixed issue #27 moved all external file calls to local

= 2.9.2 = Fixed issue #25

= 2.9.1 = Fixed Typo in line 1812, issue #24

= 2.9 = Fixed "array" when repater field has something other then text field :). has_field() now checks repeater fields as well.

= 2.8 = Fixed issue #10 by moving ajax hook to constructor. split demo meta box to 2 meta boxes.

= 2.7 = Fixed Load js on edit pages only.

= 2.6 = Fixed issue #13. Fixed issue #14.

= 2.5 = Fixed Issue #11. Added Sortable option to repeater field.

= 2.4 = Fixed WP_DEBUG errors, and taxonomy field args notice.

= 2.3 =

= 2.2 =

= 2.1 =

= 2.0 =

= 1.9 =

= 1.8 =

= 1.7 =

= 1.6 =

= 1.5 =

= 1.2 =

= 1.1 =

= 1.0 =