Skip to content

Instantly share code, notes, and snippets.

@mohammadYousefiDev
Created August 7, 2020 06:24
Show Gist options
  • Save mohammadYousefiDev/c648226265ad1af2ef5ea9ed3bf7778f to your computer and use it in GitHub Desktop.
Save mohammadYousefiDev/c648226265ad1af2ef5ea9ed3bf7778f to your computer and use it in GitHub Desktop.
practice for standard select in php - syntaxhighlighter wp plugin
<select name="syntax">
<?php
$versions = array(
3 => __( 'Version 3.x', 'domain' ),
2 => __( 'Version 2.x', 'domain' ),
);
foreach ( $versions as $version => $name ) {
echo '<option value="' . esc_attr( $version ) . '"' . selected( $this->settings['pversion'], $version, false ) . '>' . esc_html( $name ) . "</option>";
}
?>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment