esc_html__('CORE FEATURES', 'nexas'),
'features_background' => '',
'features' => ''
);
return $defaults;
}
public function __construct()
{
parent::__construct(
/*Widget ID*/
'nexas_feature_widget',
/*Widget name*/
esc_html__('Nexas Feature Widget', 'nexas'),
/*Widget Description*/
array('description' => esc_html__('Nexas Feature 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() );
/*default values*/
$features_title = apply_filters( 'widget_title', !empty( $instance['features_title'] ) ? esc_html( $instance['features_title'] ) : '', $instance, $this->id_base);
$features_background = esc_url($instance['features_background']);
$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 );
?>
0 ) {
foreach( $features as $feature ) {
if ( isset( $feature['page_ids'] ) ) { ?>
style="display:none;" >