| 1 |
<?php |
| 2 |
namespace MaxButtons; |
| 3 |
defined('ABSPATH') or die('No direct access permitted'); |
| 4 |
// Add a MaxButton widget to the pagebuilder |
| 5 |
|
| 6 |
function maxButtons_add_widget_tabs($tabs) { |
| 7 |
$tabs[] = array( |
| 8 |
'title' => __('MaxButtons', 'maxbuttons'), |
| 9 |
'filter' => array( |
| 10 |
'groups' => array('maxbuttons') |
| 11 |
) |
| 12 |
); |
| 13 |
|
| 14 |
return $tabs; |
| 15 |
} |
| 16 |
add_filter('siteorigin_panels_widget_dialog_tabs', maxUtils::namespaceit('maxbuttons_add_widget_tabs'), 20); |
| 17 |
|
| 18 |
function maxbuttons_add_widgets($folders) |
| 19 |
{ |
| 20 |
$folders[] = plugin_dir_path(__FILE__). 'widgets/'; |
| 21 |
|
| 22 |
return $folders; |
| 23 |
} |
| 24 |
add_filter('siteorigin_widgets_widget_folders', maxUtils::namespaceit('maxbuttons_add_widgets'), 20); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
function maxbuttons_fields_class_paths( $class_paths ) { |
| 29 |
|
| 30 |
$class_paths[] = plugin_dir_path( __FILE__ ) . "fields/"; |
| 31 |
return $class_paths; |
| 32 |
} |
| 33 |
add_filter( 'siteorigin_widgets_field_class_paths', maxUtils::namespaceit('maxbuttons_fields_class_paths'), 20 ); |
| 34 |
|
| 35 |
function maxbuttons_class_prefixes( $class_prefixes ) { |
| 36 |
$class_prefixes[] = maxUtils::namespaceit('MaxButton_Widget_Field_'); |
| 37 |
return $class_prefixes; |
| 38 |
} |
| 39 |
add_filter( 'siteorigin_widgets_field_class_prefixes', maxUtils::namespaceit('maxbuttons_class_prefixes'), 20 ); |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|