to avoid having to manually put in one among a number of potential
values. The options are hardcoded, time can be spent later on
retrieving them as intelligently as the rest of the view_file
field attributes are.
<?php esc_attr_e( 'View File:', 'text_domain' ); ?>
</label>
- <input
+ <select
class="widefat"
id="<?php echo esc_attr( $this->get_field_id( 'view_file' ) ); ?>"
- name="<?php echo esc_attr( $this->get_field_name( 'view_file' ) ); ?>"
- type="text"
- value="<?php echo esc_attr( $view_file ); ?>">
+ name="<?php echo esc_attr( $this->get_field_name( 'view_file' ) ); ?>">
+ <option value="footer" <?php if ( esc_attr( $view_file ) == "footer" ) { echo "selected";} ?>>Footer</option>
+ <option value="social-media" <?php if ( esc_attr( $view_file ) == "social-media" ) { echo "selected";} ?>>Social Media</option>
+ </select>
+
</p>
<?php
}