项目作者: sultann

项目描述 :
A Custom metabox framework for WordPress to quickly generate metaboxes
高级语言: CSS
项目地址: git://github.com/sultann/metabox.git
创建时间: 2018-06-20T06:00:15Z
项目社区:https://github.com/sultann/metabox

开源协议:

下载


Metabox

Description

Metabox is a developer’s toolkit for building metaboxes, custom fields, and forms for WordPress that will blow your mind. Easily manage meta for custom post types.

You can see a list of available field types here.

Installation

  1. Place the metabox directory inside of your theme or plugin.
  2. Now include the metabox class require dirname(__FILE__) . '/metabox/class-metabox.php';.
  1. add_action( 'admin_init', 'add_custom_metabox' );
  2. function(add_custom_metabox){
  3. $metabox = new \Pluginever\Framework\Metabox( 'html-id' );
  4. $config = array(
  5. 'title' => __( 'Metabox Settings', 'wpcp' ),
  6. 'screen' => 'post',
  7. 'context' => 'normal',
  8. 'priority' => 'high',
  9. 'lazy_loading' => 'true',
  10. 'class' => 'custom-class',
  11. 'fields' => [
  12. [
  13. 'type' => 'text',
  14. 'label' => __( 'Example Field', 'wpcp' ),
  15. 'name' => 'example_field',
  16. 'sanitize' => 'esc_html',
  17. ],
  18. ],
  19. );
  20. $metabox->init( $config );
  21. }
  1. Profit.

View CHANGELOG