<?php
/**
 * @package MatrixAddons
 * @subpackage trainifyframework
 * @since trainifyframework 1.0.0
 * @version 1.0.0
 * @description this file for page list field
 */
?>
<p class="tff-widget-field-wrapper <?php echo esc_attr($trainify_framework_widget_field_wraper); ?>">
	<label for="<?php echo esc_attr( $trainifyframeworkwidget->get_field_id( $trainify_framework_widget_field_name ) ); ?>">
		<?php echo esc_html( $trainify_framework_widget_field_title ); ?>: 
	</label>
	<?php
	/* see more here https://codex.wordpress.org/Function_Reference/wp_dropdown_pages*/
	$args = array(
		'selected'              => $trainify_framework_widget_field_value,
		'name'                  => esc_attr( $trainifyframeworkwidget->get_field_name( $trainify_framework_widget_field_name ) ),
		'id'                    => esc_attr( $trainifyframeworkwidget->get_field_id( $trainify_framework_widget_field_name ) ),
		'class'                 => 'widefat',
		'show_option_none'      => esc_html__('Select Page','trainify'),
		'option_none_value'     => 0 // string
	);
	wp_dropdown_pages( $args );

	if ( isset( $trainify_framework_widget_field_description ) ) { 
		?>
		<br/>
		<small><?php echo esc_html( $trainify_framework_widget_field_description ); ?></small>
		<?php 
	} 
	?>
</p>
