'business-kit-social social-widgets', 'description' => esc_html__( 'Widget to display social links with icon', 'business-kit' ), ); parent::__construct( 'business-kit-social', esc_html__( 'BK: Social', 'business-kit' ), $opts ); } /** * Echo the widget content. * * @since 1.0.0 * * @param array $args Display arguments including before_title, after_title, * before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. */ function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); echo $args['before_widget']; if ( ! empty( $title ) ) { echo $args['before_title'] . esc_html( $title ). $args['after_title']; } if ( has_nav_menu( 'social' ) ) { wp_nav_menu( array( 'theme_location' => 'social', 'link_before' => '', 'link_after' => '', ) ); } echo $args['after_widget']; } /** * Update widget instance. * * @since 1.0.0 * * @param array $new_instance New settings for this instance as input by the user via * {@see WP_Widget::form()}. * @param array $old_instance Old settings for this instance. * @return array Settings to save or bool false to cancel saving. */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); return $instance; } /** * Output the settings update form. * * @since 1.0.0 * * @param array $instance Current settings. * @return void */ function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', ) ); ?>

'business-kit-latest-news blog-section grey-bg', 'description' => esc_html__( 'Latest News Widget', 'business-kit' ), ); parent::__construct( 'business-kit-latest-news', esc_html__( 'BK: Latest News', 'business-kit' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $post_category = ! empty( $instance['post_category'] ) ? $instance['post_category'] : 0; $exclude_categories = !empty( $instance[ 'exclude_categories' ] ) ? esc_attr( $instance[ 'exclude_categories' ] ) : ''; $excerpt_length = !empty( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : ''; $disable_author = ! empty( $instance['disable_author'] ) ? $instance['disable_author'] : 0; $disable_date = ! empty( $instance['disable_date'] ) ? $instance['disable_date'] : 0; echo $args['before_widget']; if ( !empty( $title ) || !empty( $sub_title ) ){ ?>

3, 'no_found_rows' => true, 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => true, ); if ( absint( $post_category ) > 0 ) { $query_args['cat'] = absint( $post_category ); } if ( !empty( $exclude_categories ) ) { $exclude_ids = explode(',', $exclude_categories); $query_args['category__not_in'] = $exclude_ids; } $all_posts = new WP_Query( $query_args ); if ( $all_posts->have_posts() ) :?>
have_posts() ) : $all_posts->the_post(); ?>

'', 'sub_title' => '', 'post_category' => '', 'exclude_categories' => '', 'excerpt_length' => 15, 'disable_author' => 0, 'disable_date' => 0, ) ); ?>

'name', 'hide_empty' => 0, 'class' => 'widefat', 'taxonomy' => 'category', 'name' => $this->get_field_name( 'post_category' ), 'id' => $this->get_field_id( 'post_category' ), 'selected' => absint( $instance['post_category'] ), 'show_option_all' => esc_html__( 'All Categories','business-kit' ), ); wp_dropdown_categories( $cat_args ); ?>

id="get_field_id( 'disable_author' ); ?>" name="get_field_name( 'disable_author' ); ?>" />

id="get_field_id( 'disable_date' ); ?>" name="get_field_name( 'disable_date' ); ?>" />

'business-kit-cta advanced-cta-section overlay-dark', 'description' => esc_html__( 'Call To Action Widget', 'business-kit' ), ); parent::__construct( 'business-kit-cta', esc_html__( 'BK: CTA', 'business-kit' ), $opts ); } /** * Echo the widget content. * * @since 1.0.0 * * @param array $args Display arguments including before_title, after_title, * before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. */ function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $cta_page = !empty( $instance['cta_page'] ) ? $instance['cta_page'] : ''; $button_text = ! empty( $instance['button_text'] ) ? esc_html( $instance['button_text'] ) : ''; $button_url = ! empty( $instance['button_url'] ) ? esc_url( $instance['button_url'] ) : ''; $bg_pic = ! empty( $instance['bg_pic'] ) ? esc_url( $instance['bg_pic'] ) : ''; // Add background image. if ( ! empty( $bg_pic ) ) { $background_style = ''; $background_style .= ' style="background-image:url(' . esc_url( $bg_pic ) . ');" '; $args['before_widget'] = implode( $background_style . ' ' . 'class="bg_enabled ', explode( 'class="', $args['before_widget'], 2 ) ); } echo $args['before_widget']; if ( $cta_page ) { $cta_args = array( 'posts_per_page' => 1, 'page_id' => absint( $cta_page ), 'post_type' => 'page', 'post_status' => 'publish', ); $cta_query = new WP_Query( $cta_args ); if( $cta_query->have_posts()){ while( $cta_query->have_posts()){ $cta_query->the_post(); ?>

'', 'sub_title' => '', 'cta_page' => '', 'button_text' => esc_html__( 'Find More', 'business-kit' ), 'button_url' => '', 'bg_pic' => '', ) ); $bg_pic = ''; if ( ! empty( $instance['bg_pic'] ) ) { $bg_pic = $instance['bg_pic']; } $wrap_style = ''; if ( empty( $bg_pic ) ) { $wrap_style = ' style="display:none;" '; } $image_status = false; if ( ! empty( $bg_pic ) ) { $image_status = true; } $delete_button = 'display:none;'; if ( true === $image_status ) { $delete_button = 'display:inline-block;'; } ?>

$this->get_field_id( 'cta_page' ), 'class' => 'widefat', 'name' => $this->get_field_name( 'cta_page' ), 'selected' => esc_attr( $instance[ 'cta_page' ] ), 'show_option_none' => esc_html__( '— Select —', 'business-kit' ), ) ); ?>

> <?php esc_attr_e( 'Preview', 'business-kit' ); ?>
'business-kit-services services-section', 'description' => esc_html__( 'Widget to display services with image, title and short description.', 'business-kit' ), ); parent::__construct( 'business-kit-services', esc_html__( 'BK: Services', 'business-kit' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $disable_link = ! empty( $instance['disable_link'] ) ? $instance['disable_link'] : 0; $services_ids = array(); $item_number = 9; for ( $i = 1; $i <= $item_number; $i++ ) { if ( ! empty( $instance["item_id_$i"] ) && absint( $instance["item_id_$i"] ) > 0 ) { $id = absint( $instance["item_id_$i"] ); $services_ids[ $id ]['id'] = $id; $services_ids[ $id ]['desc'] = $instance["item_desc_$i"]; } } echo $args['before_widget']; if ( !empty( $title ) || !empty( $sub_title ) ){ ?>

count( $services_ids ), 'post__in' => wp_list_pluck( $services_ids, 'id' ), 'orderby' => 'post__in', 'post_type' => 'page', 'no_found_rows' => true, ); $all_services = get_posts( $query_args ); ?>

ID ]['desc'] ) ){ ?>

ID ]['desc'] ); ?>

'', 'sub_title' => '', 'disable_link' => 0, ); $item_number = 9; for ( $i = 1; $i <= $item_number; $i++ ) { $defaults["item_id_$i"] = ''; $defaults["item_desc_$i"] = ''; } $instance = wp_parse_args( (array) $instance, $defaults ); ?>

id="get_field_id( 'disable_link' ); ?>" name="get_field_name( 'disable_link' ); ?>" />


$this->get_field_id( "item_id_$i" ), 'class' => 'widefat', 'name' => $this->get_field_name( "item_id_$i" ), 'selected' => esc_attr( $instance["item_id_$i"] ), 'show_option_none' => esc_html__( '— Select —', 'business-kit' ), ) ); ?>

" name="get_field_name( "item_desc_$i" ) ); ?>" type="text" value="" />

'business-kit-about about-us-section', 'description' => esc_html__( 'Widget to display about us section', 'business-kit' ), ); parent::__construct( 'business-kit-about', esc_html__( 'BK: About Us', 'business-kit' ), $opts ); } /** * Echo the widget content. * * @since 1.0.0 * * @param array $args Display arguments including before_title, after_title, * before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. */ function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $about_page = !empty( $instance['about_page'] ) ? $instance['about_page'] : ''; $image_alignment = !empty( $instance['image_alignment'] ) ? $instance['image_alignment'] : ''; $excerpt_length = !empty( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 20; $read_more_text = !empty( $instance['read_more_text'] ) ? $instance['read_more_text'] : ''; echo $args['before_widget']; ?>

1, 'page_id' => absint( $about_page ), 'post_type' => 'page', 'post_status' => 'publish', ); $about_query = new WP_Query( $about_args ); if( $about_query->have_posts()){ while( $about_query->have_posts()){ $about_query->the_post(); ?>
' . esc_html( $read_more_text ) . ''; } ?>
'', 'sub_title' => '', 'about_page' => '', 'image_alignment' => 'right', 'excerpt_length' => 45, 'read_more_text' => esc_html__( 'Read More', 'business-kit' ), ) ); ?>

$this->get_field_id( 'about_page' ), 'class' => 'widefat', 'name' => $this->get_field_name( 'about_page' ), 'selected' => esc_attr( $instance[ 'about_page' ] ), 'show_option_none' => esc_html__( '— Select —', 'business-kit' ), ) ); ?>

dropdown_image_alignment( array( 'id' => $this->get_field_id( 'image_alignment' ), 'name' => $this->get_field_name( 'image_alignment' ), 'selected' => esc_attr( $instance['image_alignment'] ), ) ); ?>

'', 'class' => 'widefat', 'name' => '', 'selected' => 'right', ); $r = wp_parse_args( $args, $defaults ); $output = ''; $choices = array( 'left' => esc_html__( 'Left', 'business-kit' ), 'right' => esc_html__( 'Right', 'business-kit' ), ); if ( ! empty( $choices ) ) { $output = "\n"; } echo $output; } } endif; if ( ! class_exists( 'Business_Kit_Features_Widget' ) ) : /** * Features widget class. * * @since 1.0.0 */ class Business_Kit_Features_Widget extends WP_Widget { function __construct() { $opts = array( 'classname' => 'business-kit-features features-section', 'description' => esc_html__( 'Widget to display features with icon', 'business-kit' ), ); parent::__construct( 'business-kit-features', esc_html__( 'BK: Features', 'business-kit' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $excerpt_length = !empty( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 20; $disable_link = ! empty( $instance['disable_link'] ) ? $instance['disable_link'] : 0; $features_ids = array(); $item_number = 9; for ( $i = 1; $i <= $item_number; $i++ ) { if ( ! empty( $instance["item_id_$i"] ) && absint( $instance["item_id_$i"] ) > 0 ) { $id = absint( $instance["item_id_$i"] ); $features_ids[ $id ]['id'] = $id; $features_ids[ $id ]['icon'] = $instance["item_icon_$i"]; } } echo $args['before_widget']; ?>

count( $features_ids ), 'post__in' => wp_list_pluck( $features_ids, 'id' ), 'orderby' => 'post__in', 'post_type' => 'page', 'no_found_rows' => true, ); $all_features = get_posts( $query_args ); ?>

'', 'sub_title' => '', 'excerpt_length' => 20, 'disable_link' => 1, ); $item_number = 9; for ( $i = 1; $i <= $item_number; $i++ ) { $defaults["item_id_$i"] = ''; $defaults["item_icon_$i"] = 'icon-pencil'; } $instance = wp_parse_args( (array) $instance, $defaults ); ?>

id="get_field_id( 'disable_link' ); ?>" name="get_field_name( 'disable_link' ); ?>" />

here' ); ?>


$this->get_field_id( "item_id_$i" ), 'class' => 'widefat', 'name' => $this->get_field_name( "item_id_$i" ), 'selected' => esc_attr( $instance["item_id_$i"] ), 'show_option_none' => esc_html__( '— Select —', 'business-kit' ), ) ); ?>

" name="get_field_name( "item_icon_$i" ) ); ?>" type="text" value="" />