esc_html__( 'You can add a fullwidth slider with this widget.', 'bumbeelbee' ), ) // Args ); } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { $defaults = array( 'title' => __( 'Main Slider', 'bumbeelbee' ), ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

-1 ); $atts['post_type'] = 'slider'; if ( $tax_cat ) { //$id = $idObj->term_id; $atts['tax_query'] = array( array( 'taxonomy' => 'slider_type', 'field' => 'slug', 'terms' => $tax_cat, ) ); } // var_dump($atts); // die; $posts = new WP_Query( $atts ); wp_reset_postdata(); return $posts; } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { $defaults = array( 'title' => __( 'Recent posts', 'bumbeelbee' ), 'bumbeelbee_category' => '', 'order' => 'desc' ); $instance = wp_parse_args( (array) $instance, $defaults ); echo $args['before_widget']; $filepath = get_template_directory() . '/include/library/widgets/widget-bumbeelbee-homepage-slider/layouts/slider.php'; $posts = $this->get_posts( $instance ); if ( file_exists( $filepath ) ) { include $filepath; } else { esc_html_e( 'Please configure your widget', 'bumbeelbee' ); } echo $args['after_widget']; } }