Opened 10 years ago
Closed 10 years ago
#24868 closed defect (bug) (fixed)
Gallery shortcode removes orderby
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
WordPress doesn't support it anymore but when old shortcode still have the orderby value in the shortcode it gets removed when updating the gallery. It's still used in the shortcode and people still can add it manually when using the text editor
Attachments (1)
Change History (9)
Note: See
TracTickets for help on using
tickets.
This is not exactly a great fix, but I wasn't able to find a better solution.
The problem was that all
orderby
actions are oriented around theRandom Order
checkbox in the gallery manager. Whenever "Random Order" is checked, the orderby attribute is placed with a value of "rand" and if the checkbox is empty, then no orderby attribute is set.The patch is adding another field that keeps the old value for persistence. If the "Random Order" value is not checked, the old orderby value is stored. If it is checked, then the value is updated - and finally if it was checked, but then unchecked, the orderby is cleared.