Opened 2 years ago
Last modified 2 years ago
#60640 new enhancement
Use of "selected" function for "Week Starts On" on General Setting page
| Reported by: | bhargavbhandari90 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Administration | Version: | 6.5 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
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 Awaiting Review → 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:
2 years ago
#6
I updated your PR to resolve some conflicts against trunk.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Use "selected" function for weekdays dropdown selected