selected example

$month_count = count( $months );

        if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
            return;
        }

        $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
        ?> <label for="filter-by-date" class="screen-reader-text"><?php echo get_post_type_object( $post_type )->labels->filter_by_date; ?></label> <select name="m" id="filter-by-date"> <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option> <?php         foreach ( $months as $arc_row ) {
            if ( 0 == $arc_row->year ) {
                continue;
            }

            $month = zeroise( $arc_row->month, 2 );
            $year  = $arc_row->year;

            printf(
                "<option %s value='%s'>%s</option>\n",
                
<?php if ( ! empty( $this->label ) ) : ?> <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> <?php endif; ?> <?php if ( ! empty( $this->description ) ) : ?> <span class="description customize-control-description"><?php echo $this->description; ?></span> <?php endif; ?> <select <?php $this->link(); ?>> <?php                 foreach ( $this->choices as $value => $label ) :
                    echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value()$value, false ) . '>' . $label . '</option>';
                endforeach;
                ?> </select> </label> <button type="button" class="button-link create-menu<?php echo $value_hidden_class; ?>" data-location-id="<?php echo esc_attr( $this->location_id ); ?>" aria-label="<?php esc_attr_e( 'Create a menu for this location' ); ?>"><?php _e( '+ Create New Menu' ); ?></button> <button type="button" class="button-link edit-menu<?php echo $no_value_hidden_class; ?>" aria-label="<?php esc_attr_e( 'Edit selected menu' ); ?>"><?php _e( 'Edit Menu' ); ?></button> <?php     }
}
<?php $post_formats = get_post_format_strings();
unset( $post_formats['standard'] );
?> <tr> <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th> <td> <select name="default_post_format" id="default_post_format"> <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> <?php foreach ( $post_formats as $format_slug => $format_name ) : ?> <option<?php selected( get_option( 'default_post_format' )$format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> <?php endforeach; ?> </select> </td> </tr> <?php if ( get_option( 'link_manager_enabled' ) ) :
    ?> <tr> <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th> <td> <?php
</p> <div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id( 'nav_menu' ); ?>"><?php _e( 'Select Menu:' ); ?></label> <select id="<?php echo $this->get_field_id( 'nav_menu' ); ?>" name="<?php echo $this->get_field_name( 'nav_menu' ); ?>"> <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option> <?php foreach ( $menus as $menu ) : ?> <option value="<?php echo esc_attr( $menu->term_id ); ?>" <?php selected( $nav_menu$menu->term_id ); ?>> <?php echo esc_html( $menu->name ); ?> </option> <?php endforeach; ?> </select> </p> <?php if ( $wp_customize instanceof WP_Customize_Manager ) : ?> <p class="edit-selected-nav-menu" style="<?php echo $nav_menu_style; ?>"> <button type="button" class="button"><?php _e( 'Edit Menu' ); ?></button> </p> <?php endif; ?> </div>
'medium'    => __( 'Medium' ),
                            'large'     => __( 'Large' ),
                            'full'      => __( 'Full Size' ),
                        )
                    );

                    foreach ( $sizes as $value => $name ) :
                        ?> <# var size = data.sizes['<?php echo esc_js( $value ); ?>']; if ( size ) { #> <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'full' ); ?>> <?php echo esc_html( $name ); ?> &ndash; {{ size.width }} &times; {{ size.height }} </option> <# } #> <?php endforeach; ?> </select> </span> <# } #> </script> <?php // Template for the Gallery settings, used for example in the sidebar. ?> <script type="text/html" id="tmpl-gallery-settings"> <h2>

        $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";

        $arc_result = $wpdb->get_results( $arc_query );

        $month_count    = count( $arc_result );
        $selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;

        if ( $month_count && ! ( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
            ?> <select name='m'> <option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option> <?php
            foreach ( $arc_result as $arc_row ) {
                if ( 0 == $arc_row->yyear ) {
                    continue;
                }

                $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );

                if ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {
                    $default = ' selected="selected"';
                }
$id = '';
        } else {
            $id = $parsed_args['id'] ? " id='" . esc_attr( $parsed_args['id'] ) . "'" : " id='$name'";
        }
        $output = "<select name='{$name}'{$id} class='" . $parsed_args['class'] . "'>\n";

        if ( $show_option_all ) {
            $output .= "\t<option value='0'>$show_option_all</option>\n";
        }

        if ( $show_option_none ) {
            $_selected = selected( $option_none_value$parsed_args['selected'], false );
            $output   .= "\t<option value='" . esc_attr( $option_none_value ) . "'$_selected>$show_option_none</option>\n";
        }

        if ( $parsed_args['include_selected'] && ( $parsed_args['selected'] > 0 ) ) {
            $found_selected          = false;
            $parsed_args['selected'] = (int) $parsed_args['selected'];

            foreach ( (array) $users as $user ) {
                $user->ID = (int) $user->ID;
                if ( $user->ID === $parsed_args['selected'] ) {
                    $found_selected = true;
                }
$cur_aa = current_time( 'Y' );
    $cur_hh = current_time( 'H' );
    $cur_mn = current_time( 'i' );

    $month = '<label><span class="screen-reader-text">' .
        /* translators: Hidden accessibility text. */
        __( 'Month' ) .
    '</span><select class="form-required" ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
    for ( $i = 1; $i < 13; $i = $i + 1 ) {
        $monthnum  = zeroise( $i, 2 );
        $monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
        $month    .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected( $monthnum$mm, false ) . '>';
        /* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
        $month .= sprintf( __( '%1$s-%2$s' )$monthnum$monthtext ) . "</option>\n";
    }
    $month .= '</select></label>';

    $day = '<label><span class="screen-reader-text">' .
        /* translators: Hidden accessibility text. */
        __( 'Day' ) .
    '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
    $year = '<label><span class="screen-reader-text">' .
        /* translators: Hidden accessibility text. */
        
?> <p><label for="rss-url-<?php echo $esc_number; ?>"><?php _e( 'Enter the RSS feed URL here:' ); ?></label> <input class="widefat" id="rss-url-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][url]" type="text" value="<?php echo esc_url( $args['url'] ); ?>" /></p> <?php endifif ( $inputs['title'] ) : ?> <p><label for="rss-title-<?php echo $esc_number; ?>"><?php _e( 'Give the feed a title (optional):' ); ?></label> <input class="widefat" id="rss-title-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][title]" type="text" value="<?php echo esc_attr( $args['title'] ); ?>" /></p> <?php endifif ( $inputs['items'] ) : ?> <p><label for="rss-items-<?php echo $esc_number; ?>"><?php _e( 'How many items would you like to display?' ); ?></label> <select id="rss-items-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][items]"> <?php     for ( $i = 1; $i <= 20; ++$i ) {
        echo "<option value='$i' " . selected( $args['items']$i, false ) . ">$i</option>";
    }
    ?> </select></p> <?php endifif ( $inputs['show_summary'] || $inputs['show_author'] || $inputs['show_date'] ) : ?> <p> <?php if ( $inputs['show_summary'] ) : ?> <input id="rss-show-summary-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_summary]" type="checkbox" value="1" <?php checked( $args['show_summary'] ); ?> /> <label for="rss-show-summary-<?php echo $esc_number; ?>"><?php _e( 'Display item content?' ); ?></label><br /> <?php endifif ( $inputs['show_author'] ) : ?> <input id="rss-show-author-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_author]" type="checkbox" value="1" <?php checked( $args['show_author'] ); ?> /> <label for="rss-show-author-<?php echo $esc_number; ?>"><?php _e( 'Display item author if available?' ); ?></label><br />
<?php _e( 'Image Size' ); ?></label></th> <td><fieldset><legend class="screen-reader-text"><span> <?php             /* translators: Hidden accessibility text. */
            _e( 'Image Size' );
            ?> </span></legend> <select id="background-size" name="background-size"> <option value="auto"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option> <option value="contain"<?php selected( 'contain', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fit to Screen' ); ?></option> <option value="cover"<?php selected( 'cover', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fill Screen' ); ?></option> </select> </fieldset></td> </tr> <tr> <th scope="row"><?php _ex( 'Repeat', 'Background Repeat' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php             /* translators: Hidden accessibility text. */
            
<input type="hidden" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>" value="<?php echo esc_attr( $taxonomy ); ?>" /> <?php                 break;

            // More than one tag cloud supporting taxonomy found, display a select.             default:
                ?> <p> <label for="<?php echo $this->get_field_id( 'taxonomy' ); ?>"><?php _e( 'Taxonomy:' ); ?></label> <select class="widefat" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>"> <?php foreach ( $taxonomies as $taxonomy => $tax ) : ?> <option value="<?php echo esc_attr( $taxonomy ); ?>" <?php selected( $taxonomy$current_taxonomy ); ?>> <?php echo esc_html( $tax->labels->name ); ?> </option> <?php endforeach; ?> </select> </p> <?php         }

        if ( count( $taxonomies ) > 0 ) {
            ?> <p> <input type="checkbox" class="checkbox" id="
$term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
    ?> <form class="search-form search-plugins" method="get"> <input type="hidden" name="tab" value="search" /> <label class="screen-reader-text" for="typeselector"> <?php             /* translators: Hidden accessibility text. */
            _e( 'Search plugins by:' );
            ?> </label> <select name="type" id="typeselector"> <option value="term"<?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option> <option value="author"<?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option> <option value="tag"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option> </select> <label class="screen-reader-text" for="search-plugins"> <?php             /* translators: Hidden accessibility text. */
            _e( 'Search Plugins' );
            ?> </label> <input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" placeholder="<?php esc_attr_e( 'Search plugins...' ); ?>" /> <?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?>
    $structure = array();

    // List installed languages.     if ( $translations_available ) {
        $structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
    }

    // Site default.     if ( $parsed_args['show_option_site_default'] ) {
        $structure[] = sprintf(
            '<option value="site-default" data-installed="1"%s>%s</option>',
            selected( 'site-default', $parsed_args['selected'], false ),
            _x( 'Site Default', 'default site language' )
        );
    }

    if ( $parsed_args['show_option_en_us'] ) {
        $value       = ( $parsed_args['explicit_option_en_us'] ) ? 'en_US' : '';
        $structure[] = sprintf(
            '<option value="%s" lang="en" data-installed="1"%s>English (United States)</option>',
            esc_attr( $value ),
            selected( '', $parsed_args['selected'], false )
        );
    }
$link_cats = get_terms( array( 'taxonomy' => 'link_category' ) );
        $limit     = (int) $instance['limit'];
        if ( ! $limit ) {
            $limit = -1;
        }
        ?> <p> <label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select Link Category:' ); ?></label> <select class="widefat" id="<?php echo $this->get_field_id( 'category' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>"> <option value=""><?php _ex( 'All Links', 'links widget' ); ?></option> <?php foreach ( $link_cats as $link_cat ) : ?> <option value="<?php echo (int) $link_cat->term_id; ?>" <?php selected( $instance['category']$link_cat->term_id ); ?>> <?php echo esc_html( $link_cat->name ); ?> </option> <?php endforeach; ?> </select> <label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:' ); ?></label> <select name="<?php echo $this->get_field_name( 'orderby' ); ?>" id="<?php echo $this->get_field_id( 'orderby' ); ?>" class="widefat"> <option value="name"<?php selected( $instance['orderby'], 'name' ); ?>><?php _e( 'Link title' ); ?></option> <option value="rating"<?php selected( $instance['orderby'], 'rating' ); ?>><?php _e( 'Link rating' ); ?></option> <option value="id"<?php selected( $instance['orderby'], 'id' ); ?>><?php _e( 'Link ID' ); ?></option> <option value="rand"<?php selected( $instance['orderby'], 'rand' ); ?>><?php _ex( 'Random', 'Links widget' ); ?></option> </select> </p> <p> <input class="checkbox" type="checkbox"
?> <form id="search-themes" method="get"> <input type="hidden" name="tab" value="search" /> <?php if ( $type_selector ) : ?> <label class="screen-reader-text" for="typeselector"> <?php         /* translators: Hidden accessibility text. */
        _e( 'Type of search' );
        ?> </label> <select name="type" id="typeselector"> <option value="term" <?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option> <option value="author" <?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option> <option value="tag" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option> </select> <label class="screen-reader-text" for="s"> <?php         switch ( $type ) {
            case 'term':
                /* translators: Hidden accessibility text. */
                _e( 'Search by keyword' );
                break;
            case 'author':
                
Home | Imprint | This part of the site doesn't use cookies.