nsrosenqvist / cmb2-widget
Installs: 63
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
Type:wordpress-plugin
Requires
- php: >=7.0.0
- cmb2/cmb2: ^2.4.0
This package is auto-updated.
Last update: 2020-06-09 20:10:13 UTC
README
Lets you use CMB2 in widgets
Extend the abstract widget class.
use NSRosenqvist\CMB2\Widgets\CMB2_Widget; class MyWidget extends CMB2_Widget { protected $fields = [ // You can set ID both as the key and in the array 'title' => [ 'name' => __('Title', 'theme'), 'type' => 'text', ], ]; function __construct($id_base, $name, $widget_options = [], $control_options = []) { parent::__construct( // Base ID of widget 'my_widget' // Widget name will appear in UI 'My Widget', // Widget description $widget_options, // Widget options $control_options ); } }