nsrosenqvist / cmb2-widget
This package is abandoned and no longer maintained.
No replacement package was suggested.
Package info
github.com/nsrosenqvist/cmb2-widget
Type:wordpress-plugin
pkg:composer/nsrosenqvist/cmb2-widget
1.0.1
2018-06-19 09:37 UTC
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 ); } }