Current File : /home/kelaby89/sergio-cuchi.tattoo/wp-content/plugins/maori-features/so-widgets.php |
<?php
/* ----------------------------------------------------------
Add Widget Collection
------------------------------------------------------------- */
function add_maori_widgets_collection($folders){
$folders[] = plugin_dir_path(__FILE__).'so-widgets/';
return $folders;
}
add_filter('siteorigin_widgets_widget_folders', 'add_maori_widgets_collection');
/* ----------------------------------------------------------
Widget Groups
------------------------------------------------------------- */
function maori_add_widget_tabs($tabs) {
$tabs[] = array(
'title' => esc_html__('Maori Widgets', 'maori'),
'filter' => array(
'groups' => array('maori')
)
);
return $tabs;
}
add_filter('siteorigin_panels_widget_dialog_tabs', 'maori_add_widget_tabs', 20);
/* ----------------------------------------------------------
Activate Widgets
------------------------------------------------------------- */
function maori_filter_active_widgets($active){
$active['maori-headline'] = true;
$active['maori-img-slider'] = true;
$active['maori-carousel'] = true;
$active['maori-accordion'] = true;
$active['maori-tabs'] = true;
$active['maori-divider'] = true;
$active['maori-posts'] = true;
$active['maori-list'] = true;
$active['maori-testimonials'] = true;
$active['maori-features'] = true;
/* Siteorigin Widgets */
$active['features'] = true;
$active['social-media-buttons'] = true;
return $active;
}
add_filter('siteorigin_widgets_active_widgets', 'maori_filter_active_widgets');
/* ----------------------------------------------------------
Custom Class Prefix
------------------------------------------------------------- */
function maori_fields_class_prefixes( $class_prefixes ) {
$class_prefixes[] = 'maori_';
return $class_prefixes;
}
add_filter( 'siteorigin_widgets_field_class_prefixes', 'maori_fields_class_prefixes' );
/* ----------------------------------------------------------
Add Custom Row Field
------------------------------------------------------------- */
function maori_row_style_fields($fields) {
$fields['maoripbx'] = array(
'name' => esc_html__('Maori background', 'maori'),
'type' => 'checkbox',
'group' => 'design',
'description' => esc_html__('Add black background to the row.', 'maori'),
'priority' => 4,
);
$fields['maoribg'] = array(
'name' => esc_html__('Maori stretched background', 'maori'),
'type' => 'checkbox',
'group' => 'design',
'description' => esc_html__('Add black background to the row.', 'maori'),
'priority' => 4,
);
$fields['maorishadow'] = array(
'name' => esc_html__('Maori shadow', 'maori'),
'type' => 'checkbox',
'group' => 'design',
'description' => esc_html__('Add shadow to the row.', 'maori'),
'priority' => 4,
);
return $fields;
}
add_filter( 'siteorigin_panels_row_style_fields', 'maori_row_style_fields' );
function maori_row_style_attributes( $attributes, $args ) {
if( !empty( $args['maoripbx'] ) ) {
array_push($attributes['class'], 'maori-page-box');
}
if( !empty( $args['maoribg'] ) ) {
array_push($attributes['class'], 'maori-slider-wrapper');
}
if( !empty( $args['maorishadow'] ) ) {
array_push($attributes['class'], 'maori-add-shadow');
}
return $attributes;
}
add_filter('siteorigin_panels_row_style_attributes', 'maori_row_style_attributes', 10, 2);
/* ----------------------------------------------------------
Add Custom Widget Field
------------------------------------------------------------- */
function maori_widget_style_fields($fields) {
$fields['maorishadow'] = array(
'name' => esc_html__('Maori shadow', 'maori'),
'type' => 'checkbox',
'group' => 'design',
'description' => esc_html__('Add shadow to the widget.', 'maori'),
'priority' => 4,
);
return $fields;
}
add_filter( 'siteorigin_panels_widget_style_fields', 'maori_widget_style_fields' );
function maori_widget_style_attributes( $attributes, $args ) {
if( !empty( $args['maorishadow'] ) ) {
array_push($attributes['class'], 'maori-add-shadow');
}
return $attributes;
}
add_filter('siteorigin_panels_widget_style_attributes', 'maori_widget_style_attributes', 10, 2);
/* ----------------------------------------------------------
Add Custom Icons
------------------------------------------------------------- */
function maori_icon_families_filter( $icon_families ) {
$icon_families['maoriicon'] = array(
'name' => esc_html__( 'Maori Icons', 'maori' ),
'style_uri' => plugin_dir_url( __FILE__ ) . 'css/icons.css',
'icons' => array(
'alcohol' => '',
'apron' => '',
'autoclave' => '',
'bandage' => '',
'battery' => '',
'brushes' => '',
'cart' => '',
'cartridge' => '',
'case' => '',
'chair' => '',
'cleaningbrush' => '',
'cord' => '',
'cream' => '',
'gloves' => '',
'grip' => '',
'heart' => '',
'holder' => '',
'ink' => '',
'ink1' => '',
'keys' => '',
'license' => '',
'markers' => '',
'needle' => '',
'needles' => '',
'needles1' => '',
'notebook' => '',
'open' => '',
'pad' => '',
'paper' => '',
'pedal' => '',
'petroleum' => '',
'portfolio' => '',
'power' => '',
'razor' => '',
'rose' => '',
'ruler' => '',
'skin' => '',
'skull' => '',
'soap' => '',
'soap1' => '',
'spray' => '',
'stencil' => '',
'stool' => '',
'store' => '',
'table' => '',
'tape' => '',
'tatoomachine' => '',
'tattoo' => '',
'tips' => '',
'wipe' => ''
),
);
return $icon_families;
}
add_filter( 'siteorigin_widgets_icon_families', 'maori_icon_families_filter' );
?>