Opened 2 years ago
Last modified 21 months ago
#60640 new enhancement
Use of "selected" function for "Week Starts On" on General Setting page
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | minor | Version: | 6.5 |
| Component: | Administration | Keywords: | has-patch |
| Focuses: | Cc: |
Description
For the dropdown of weekdays for the "Week Starts On" field is using the following turnery operation for "selected=selectd"
$selected = ( get_option( 'start_of_week' ) == $day_index ) ? 'selected="selected"' : '';
We should use WP's selected function instead of turnery operation
Attachments (2)
Change History (8)
#1
@
2 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to Future Release
Note that selected() does a strict comparison (===) whereas the existing code does a loose comparison (==). This would need to use (int) get_option( 'start_of_week' ) to be safe.
This ticket was mentioned in PR #6181 on WordPress/wordpress-develop by @bhargavbhandari90.
2 years ago
#3
Trac ticket: https://core.trac.wordpress.org/ticket/60640
@mukesh27 commented on PR #6181:
2 years ago
#4
@bhargavbhandari90 commented on PR #6181:
2 years ago
#5
Thank you @mukeshpanchal27 for pointing this out. I've improved the code. Should be fine now.
@audrasjb commented on PR #6181:
21 months ago
#6
I updated your PR to resolve some conflicts against trunk.
Use "selected" function for weekdays dropdown selected