__( 'Boston Business Widgets', 'boston-business' ), 'filter' => array( 'groups' => array( 'boston-business' ), ), ); return $tabs; } endif; add_filter( 'siteorigin_panels_widget_dialog_tabs', 'boston_business_add_tab_in_builer_widgets_panel' ); if ( ! function_exists( 'boston_business_group_theme_widgets_in_builder' ) ) : /** * Grouping theme widgets in builder. * * @since 1.0 * * @param array $widgets Widgets array. * @return array Modified widgets array. */ function boston_business_group_theme_widgets_in_builder( $widgets ) { if ( isset( $GLOBALS['wp_widget_factory'] ) && ! empty( $GLOBALS['wp_widget_factory']->widgets ) ) { $all_widgets = array_keys( $GLOBALS['wp_widget_factory']->widgets ); foreach ( $all_widgets as $widget ) { if ( false !== strpos( $widget, 'Boston_Business_' ) ) { $widgets[ $widget ]['groups'] = array( 'boston-business' ); $widgets[ $widget ]['icon'] = 'dashicons dashicons-awards'; } } } return $widgets; } endif; add_filter( 'siteorigin_panels_widgets', 'boston_business_group_theme_widgets_in_builder' ); if ( ! function_exists( 'boston_business_panels_row_style_attributes' ) ) : /** * Add custom attributes in row. * * @since 1.0 * * @param array $attr Attributes. * @param array $style Widget style. * @return array Modified attributes. */ function boston_business_panels_row_style_attributes( $attr, $style ) { if ( isset( $style['row_stretch'] ) && 'full' === $style['row_stretch'] ) { $attr['class'][] = 'panel-row-style-full-width'; } if ( isset( $style['row_stretch'] ) && 'full-stretched' === $style['row_stretch'] ) { $attr['class'][] = 'panel-row-style-full-stretched'; } return $attr; } endif; add_filter( 'siteorigin_panels_row_style_attributes', 'boston_business_panels_row_style_attributes', 10, 2 ); if ( ! function_exists( 'boston_business_customize_so_widgets_status' ) ) : /** * Customize to make widgets active. * * @since 1.0 * * @param array $active Array of widgets. * @return array Modified array. */ function boston_business_customize_so_widgets_status( $active ) { $active['so-features-widget'] = true; $active['features'] = true; $active['so-slider-widget'] = true; $active['slider'] = true; $active['so-google-map-widget'] = true; $active['google-map'] = true; $active['so-image-widget'] = true; $active['image'] = true; $active['so-cta-widget'] = true; $active['cta'] = true; $active['so-contact-widget'] = true; $active['contact'] = true; $active['so-testimonial-widget'] = true; $active['testimonial'] = true; $active['so-hero-widget'] = true; $active['hero'] = true; return $active; } endif; add_filter( 'siteorigin_widgets_active_widgets', 'boston_business_customize_so_widgets_status' );