'business_point_widget_social', 'description' => esc_html__( 'Social Icons Widget', 'business-point' ), ); parent::__construct( 'business-point-social', esc_html__( 'BP: Social', 'business-point' ), $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_point_widget_latest_news', 'description' => esc_html__( 'Latest News Widget', 'business-point' ), ); parent::__construct( 'business-point-latest-news', esc_html__( 'BP: Latest News', 'business-point' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $section_icon = !empty( $instance['section_icon'] ) ? $instance['section_icon'] : ''; $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' ] ) : ''; $layout_type = !empty( $instance[ 'layout_type' ] ) ? esc_attr( $instance[ 'layout_type' ] ) : ''; $posts_to_show = !empty( $instance[ 'posts_to_show' ] ) ? esc_attr( $instance[ 'posts_to_show' ] ) : ''; $disable_date = ! empty( $instance['disable_date'] ) ? $instance['disable_date'] : 0; echo $args['before_widget']; ?>

absint( $posts_number ), '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(); ?>
post_count; $p_count = 1; while ( $all_posts->have_posts() ) : $all_posts->the_post(); ?>
'', 'section_icon' => 'fa-folder-open-o', 'sub_title' => '', 'post_category' => '', 'exclude_categories' => '', 'disable_date' => 0, 'layout_type' => 'layout-1', 'posts_to_show' => 6, ) ); ?>

'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-point' ), ); wp_dropdown_categories( $cat_args ); ?>

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

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

'', 'name' => '', 'selected' => 'layout-1', ); $r = wp_parse_args( $args, $defaults ); $output = ''; $choices = array( 'layout-1' => esc_html__( 'Layout One', 'business-point' ), 'layout-2' => esc_html__( 'Layout Two', 'business-point' ), ); if ( ! empty( $choices ) ) { $output = "\n"; } echo $output; } } endif; if ( ! class_exists( 'Business_Point_CTA_Widget' ) ) : /** * CTA widget class. * * @since 1.0.0 */ class Business_Point_CTA_Widget extends WP_Widget { /** * Constructor. * * @since 1.0.0 */ function __construct() { $opts = array( 'classname' => 'business_point_widget_call_to_action', 'description' => esc_html__( 'Call To Action Widget', 'business-point' ), ); parent::__construct( 'business-point-cta', esc_html__( 'BP: CTA', 'business-point' ), $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 ); $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'] ) : ''; $secondary_button_text = ! empty( $instance['secondary_button_text'] ) ? esc_html( $instance['secondary_button_text'] ) : ''; $secondary_button_url = ! empty( $instance['secondary_button_url'] ) ? esc_url( $instance['secondary_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']; ?>
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(); ?>
'', 'cta_page' => '', 'button_text' => esc_html__( 'Find More', 'business-point' ), 'button_url' => '', 'secondary_button_text' => esc_html__( 'Buy Now', 'business-point' ), 'secondary_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' => $instance[ 'cta_page' ], 'show_option_none' => esc_html__( '— Select —', 'business-point' ), ) ); ?>


> <?php esc_attr_e( 'Preview', 'business-point' ); ?>
'business_point_widget_services', 'description' => esc_html__( 'Display services.', 'business-point' ), ); parent::__construct( 'business-point-services', esc_html__( 'BP: Services', 'business-point' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $section_icon = !empty( $instance['section_icon'] ) ? $instance['section_icon'] : ''; $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $excerpt_length = !empty( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 20; $read_more_text = !empty( $instance['read_more_text'] ) ? $instance['read_more_text'] : ''; $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 ]['icon'] = $instance["item_icon_$i"]; } } echo $args['before_widget']; ?>

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 ); ?>

' . esc_html( $read_more_text ) . ''; } ?>
'', 'section_icon' => 'fa-laptop', 'sub_title' => '', 'excerpt_length' => 20, 'read_more_text' => esc_html__( 'Read More', 'business-point' ), ); $item_number = 9; for ( $i = 1; $i <= $item_number; $i++ ) { $defaults["item_id_$i"] = ''; $defaults["item_icon_$i"] = 'fa-cog'; } $instance = wp_parse_args( (array) $instance, $defaults ); ?>

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

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

'business_point_widget_newsletter', 'description' => esc_html__( 'Newsletter with mailchimp form', 'business-point' ), ); parent::__construct( 'business-point-newsletter', esc_html__( 'BP: Newsletter', 'business-point' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $section_icon = !empty( $instance['section_icon'] ) ? $instance['section_icon'] : ''; $sub_title = !empty( $instance['sub_title'] ) ? $instance['sub_title'] : ''; $newsletter_shortcode = !empty( $instance['newsletter_shortcode'] ) ? $instance['newsletter_shortcode'] : ''; $overlay_type = !empty( $instance['overlay_type'] ) ? $instance['overlay_type'] : ''; $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="overlay-'.esc_html( $overlay_type ).' bg_enabled ', explode( 'class="', $args['before_widget'], 2 ) ); } echo $args['before_widget']; ?>

'', 'section_icon' => 'fa-envelope-o', 'sub_title' => '', 'newsletter_shortcode' => '', 'overlay_type' => 'light', 'bg_pic' => '', ); $instance = wp_parse_args( (array) $instance, $defaults ); $newsletter_shortcode = !empty( $instance['newsletter_shortcode'] ) ? $instance['newsletter_shortcode'] : ''; $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;'; } ?>

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

> <?php esc_attr_e( 'Preview', 'business-point' ); ?>
'', 'class' => 'widefat', 'name' => '', 'selected' => 'light', ); $r = wp_parse_args( $args, $defaults ); $output = ''; $choices = array( 'light' => esc_html__( 'Light', 'business-point' ), 'dark' => esc_html__( 'Dark', 'business-point' ), 'none' => esc_html__( 'None', 'business-point' ), ); if ( ! empty( $choices ) ) { $output = "\n"; } echo $output; } } endif; if ( ! class_exists( 'Business_Point_Recent_Posts_Widget' ) ) : /** * Recent Posts widget class. * * @since 1.0.0 */ class Business_Point_Recent_Posts_Widget extends WP_Widget { function __construct() { $opts = array( 'classname' => 'business_point_widget_advanced_recent_posts', 'description' => esc_html__( 'Widget to display recent posts with thumbnail. Receommneded to use in sidebar or footer widgets area.', 'business-point' ), ); parent::__construct( 'business-point-advanced-recent-posts', esc_html__( 'BP: Advanced Recent Posts', 'business-point' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $post_number = ! empty( $instance['post_number'] ) ? $instance['post_number'] : 5; echo $args['before_widget']; ?>
absint( $post_number ), 'no_found_rows' => true, 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => true, 'post_status' => 'publish', ); $recent_posts = new WP_Query( $recent_args ); if ( $recent_posts->have_posts() ) : while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); ?>

esc_html__( 'Recent Posts', 'business-point' ), 'post_number' => 5, ) ); ?>