'',
'features' =>'',
);
return $defaults;
}
public function __construct()
{
parent::__construct(
/*Widget ID */
'nexas_testimonial_widget',
/*Widget Name */
esc_html__( 'Nexas Testimonial Widget', 'nexas' ),
/*Widget Description */
array('description' => esc_html__( 'Nexas Testimonial Section', 'nexas' ) )
);
}
/**
* 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)
{
if (!empty($instance))
{
$instance = wp_parse_args((array )$instance, $this->defaults());
$bg_image = esc_url($instance['bg_image']);
$features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array();
echo $args['before_widget'];
?>
= 1 && is_array( $features ) )
{
$selected = $features['main'];
}
else
{
$selected = "";
}
$repeater_id = $this->get_field_id( 'features' ).'-main';
$repeater_name = $this->get_field_name( 'features'). '[main]';
$args = array(
'selected' => $selected,
'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 );
$counter = 0;
if ( count( $features ) > 0 )
{
foreach( $features as $feature )
{
if ( isset( $feature['page_ids'] ) )
{ ?>
style="display:none;" >