select.php 909 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin
  6. */
  7. if ( ! defined( 'WPSEO_VERSION' ) ) {
  8. header( 'Status: 403 Forbidden' );
  9. header( 'HTTP/1.1 403 Forbidden' );
  10. exit();
  11. }
  12. /**
  13. * @var string $attributes Additional attributes for the select
  14. * @var string $name Value for the select name attribute.
  15. * @var string $id ID attribute for the select.
  16. * @var array $options Array with the options to show.
  17. * @var string $selected The current set options.
  18. */
  19. ?>
  20. <select <?php echo $attributes; ?>name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>">
  21. <?php foreach ( $options as $option_attribute_value => $option_html_value ) : ?>
  22. <option value="<?php echo esc_attr( $option_attribute_value ); ?>"<?php echo selected( $selected, $option_attribute_value, false ); ?>><?php echo esc_html( $option_html_value ); ?></option>
  23. <?php endforeach; ?>
  24. </select>