You’re not actually outputting the selected
attribute into the <option>
tag. Look at your printf()
format:
'<option value="%u">%s</option>'
%u
is there for the month’s number value, and %s
is there for month’s name, but you’re not including the last argument from the result of selected()
.
Your printf()
needs to look like this:
printf(
'<option value="%u" %s>%s</option>',
$num,
selected( $birth_date_month, $num, false ),
$month
);
Note that I swapped the order of the arguments, because selected
needs to be output before the month name.
Related Posts:
- How to use wp_nav_menu to create a select menu dropdown?
- how to get value of wp_dropdown_categories
- Filter a second dropdown list when a value is chosen in the first one
- Improving the Thesis built-in dropdown menu via javascript
- Add submenu using the bootstrap wp_nav_menu
- Drop-down menu with wp_dropdown_pages
- How to number the options in a wp_dropdown_pages() select?
- Selected attribute of Drop down list
- Ultimate Member callback function issue
- Filter table with dropdown
- Get the selected option from drop down list
- pages meta box – get_categories dropdown
- Bootstrap drop down Navigation Menu in WordPress
- wp_dropdown_pages : choose post status to list in dropdown
- create drop down menu
- How to populate a dropdown menu with option selected?
- Link to subpages on the same page
- Using wp_dropdown_users and selected() function?
- working with result of wp_dropdown_pages()
- Help with a get_categories () drop down menu – I want it to show in heirachial form
- Dropdown list control in a post
- wp_dropdown_users array for param selected
- top primary menu drop down categories not showing
- First ID won’t be excluded in wp_dropdown_pages with an $arg from tax_query
- Multiple Dropdown’s with Submit Button
- Create a drop down list within an active page not nav menu
- wp_dropdown_categories – remove
- PayPal button with drop down menu not working [closed]
- How to solve dropdown menu problem [closed]
- Select default option value from typescript angular 6
- Custom Taxonomy as Dropdown in admin
- Block Editor: add an aria-label to an option inside a SelectControl
- Drop down+sort blog posts date added/most popular
- How can I show drafts in wp_dropdown_pages list?
- How do I create a drop down menu in a widget?
- Dropdown list of a custom post type
- Add filter to wp_dropdown_pages() or wp_dropdown_categories() – no select container?
- Custom widget using get_categories select menu dropdown
- Search results sorted by post types
- Admin menu bar dropdown opens when I click on a form element (Chrome) [closed]
- wp_dropdown_categories and custom taxonomy + custom post type
- How to provide value for ‘selected’ on wp_dropdown_categories() for ‘multiple’ options
- How to make drop down post title
- WordPress 3.5 dropdown menu
- Populate meta select box with child pages
- Additional form options based on category selected not working
- Menu item with no page, but with dropdown
- custom wp_dropdown_categories items in wordpress
- Easiest way to add dropdown to a page
- Populate dropdown from database
- Using a shortcode to create a dropdown menu from wp_nav_menu list items
- Options page – dropdown of users
- Menu in left side don’t appears with dropdown
- Display parent and child taxonomies in separate drop down select fields
- getting the current sub item out of total sub items in a given dropdown (custom walker)
- Displaying list of cities according to the selected state. Using the WordPress hook
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- Create custom taxonomy and Display in metabox dropdown
- Dropdown filtering extremely slow
- styling wp_nav_menu – horizontal, sub-menu drop downs
- Trying to get variables in hacked category dropdown
- Form to post new post with custom taxonomies
- Using wp_dropdown_categories in widget options
- Extend the twentyten dropdown menu with jQuery with a delay onmouseout
- Unable to display selected post title in frontend from metabox wp_dropdown_pages()
- Modify output of wp_dropdown_categories to add term IDs to each option
- Use a filter on menu items that have children
- WordPress custom dropdown listings
- Add search to ‘Parent’ dropdown
- Filter custom post types by custom field using AJAX
- Show only first child in dropdown
- Display Taxonomy Term Children in a Drop Down without Submit Button
- Drop Down menu expanded by default (on front page) [closed]
- Search box with field hidden till drop down selection is made
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- Select Venue from dropdown list and reuse stored address information in meta_box
- Is possible hide hierarchical select dropdown created by jetsmartfilters? (only visual issue)
- Admin user name not showing up in author dropdown
- Filter posts by month (dropdown)
- Get_term_meta() always returns false
- WordPress menu issue – if there are child links partents won’t click
- Drodown list return issue
- Show archives as a drop-down in the main navigation menu
- custom browse by
- dropdown with no submit
- ajax drop down change second drop down data
- How to make featured area?
- Save data of select list after clicking save
- Fetching posts that match a User Profile setting
- Custom Query for searching through custom fields
- Separate categories parents, childs and grandchilds in dropdowns
- Dropdown Menu for Query_Posts
- Unable to display the post titles in a drop down
- Drop down menu’s not saving using Custom Meta Boxs in WordPress
- How to add posts with thumbnails to my dropdown menu?
- how to search through plugin in wordpress cimy-user-extra-fields?
- Open WordPress Page from selected option dropdown
- Add a page to a subscribers account
- Menu items do not “open” when mouse hover over them?
- Display post by select it from a dropdown menu