'',
'sub_title' => '',
'nexas_page_items' => '',
);
function __construct() {
parent::__construct(
/*Base ID of your widget*/
'nexas_our_team_widget',
/*Widget name will appear in UI*/
__( 'Nexas Team Section', 'nexas' ),
/*Widget description*/
array( 'description' => __( 'Nexas Our Team Section With Repeater.', 'nexas' ), )
);
}
/*Widget Backend*/
public function form( $instance ) {
$instance = wp_parse_args( (array) $instance, $this->defaults );
/*default values*/
$title = esc_attr( $instance['title'] );
$sub_title = esc_attr( $instance['sub_title'] );
$nexas_page_items = $instance['nexas_page_items'];
?>
0 && is_array($nexas_page_items) ){
foreach ($nexas_page_items as $about){
$repeater_id = $this->get_field_id( 'nexas_page_items') .$total_repeater.'page_id';
$repeater_name = $this->get_field_name( 'nexas_page_items' ).'['.$total_repeater.']['.'page_id'.']';
?>
$about['page_id'],
'name' => $repeater_name,
'id' => $repeater_id,
'class' => 'widefat pt-select',
'show_option_none' => __( 'Select Page', 'nexas'),
'option_none_value' => 0 // string
);
wp_dropdown_pages( $args );
?>
get_field_id( 'nexas_page_items') .$coder_repeater_depth.'page_id';
$repeater_name = $this->get_field_name( 'nexas_page_items' ).'['.$coder_repeater_depth.']['.'page_id'.']';
?>
';
$add_field = __('Add Item', 'nexas');
echo '
'.$add_field.'';
?>
0 && is_array($nexas_page_items) ){
foreach ($nexas_page_items as $key=>$about ){
$page_ids[$key]['page_id'] = absint( $about['page_id'] );
}
}
}
$instance['nexas_page_items'] = $page_ids;
return $instance;
}
/**
* Function to Creating widget front-end. This is where the action happens
*
* @access public
* @since 1.0
*
* @param array $args widget setting
* @param array $instance saved values
*
* @return void
*
*/
public function widget( $args, $instance ) {
$instance = wp_parse_args( (array) $instance, $this->defaults );
/*default values*/
$title = apply_filters( 'widget_title', ! empty( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base );
$sub_title = apply_filters( 'widget_title', ! empty( $instance['sub_title'] ) ? $instance['sub_title'] : '', $instance, $this->id_base );
$nexas_page_items = $instance['nexas_page_items'];
echo $args['before_widget'];
?>
0 && is_array($nexas_page_items) ){
foreach ( $nexas_page_items as $our_team ){
if( isset( $our_team['page_id'] ) && !empty( $our_team['page_id'] ) ){
$post_in[] = $our_team['page_id'];
}
}
}
if( !empty( $post_in )) :
$our_team_page_args = array(
'post__in' => $post_in,
'orderby' => 'post__in',
'posts_per_page' => count( $post_in ),
'post_type' => 'page',
'no_found_rows' => true,
'post_status' => 'publish'
);
$our_team_query = new WP_Query( $our_team_page_args );
/*The Loop*/
if ( $our_team_query->have_posts() ):
$i = 1;
while ( $our_team_query->have_posts() ):$our_team_query->the_post();
?>
" data-wow-delay="s">