esc_html__('Our Work', 'business-form'), 'sub-title' => '', 'business_form_portfolio_filter_all' => esc_html__('All', 'business-form'), 'cat_id' => array(), 'section-id' =>'', ); return $defaults; } public function __construct() { parent::__construct( 'business-form-our-work-widget', esc_html__('AT : Work Widget', 'business-form'), array('description' => esc_html__('Business Work Section', 'business-form')) ); } public function widget($args, $instance) { $instance = wp_parse_args((array)$instance, $this->defaults()); if (!empty($instance)) { $section_id = esc_attr($instance['section-id']); $subtitle = esc_html($instance['sub-title']); $title = apply_filters('widget_title', !empty($instance['title']) ? esc_html($instance['title']) : '', $instance, $this->id_base); $business_form_ad_title = esc_html($instance['business_form_portfolio_filter_all']); $business_form_selected_cat = ''; if (!empty($instance['cat_id'])) { $business_form_selected_cat = business_form_sanitize_multiple_category($instance['cat_id']); if (is_array($business_form_selected_cat[0])) { $business_form_selected_cat = $business_form_selected_cat[0]; } } echo $args['before_widget']; ?>

30, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'post__not_in' => $sticky, 'orderby' => 'post_date', 'order' => 'DESC', ); if (-1 != $business_form_cat_post_args) { $business_form_cat_post_args['category__in'] = $business_form_selected_cat; } $portfolio_filter_query = new WP_Query($business_form_cat_post_args); ?>
    ' . $business_form_ad_title . ''; } if (!empty($business_form_selected_cat) && is_array($business_form_selected_cat)) { foreach ($business_form_selected_cat as $business_form_selected_single_cat) { echo '
  • ' . esc_html(get_cat_name($business_form_selected_single_cat)) . '
  • '; } } ?>
have_posts()): while ($portfolio_filter_query->have_posts()): $portfolio_filter_query->the_post(); $categories = get_the_category(get_the_ID()); if (!empty($categories)) { foreach ($categories as $category) { $select_cat = $category->term_id; ?>

defaults()); $title = esc_attr($instance['title']); $subtitle = esc_attr($instance['sub-title']); $business_form_ad_title = esc_attr($instance['business_form_portfolio_filter_all']); $business_form_selected_cat = ''; if (!empty($instance['cat_id'])) { $business_form_selected_cat = $instance['cat_id']; if (is_array($business_form_selected_cat[0])) { $business_form_selected_cat = $business_form_selected_cat[0]; } } ?>