aguko
Post count: 43
|
I want to order incoming objects title by the custom field (DatePicker’s date) order which it has.
Can I use MEOW_FieldSetCollection :: psort ?
|
traversal
Post count: 207
|
You should be able to use one of the WOOF_Collection sorting methods. Suppose you have a field set called “details” and a field called date. Try something like:
foreach ($wf->the->incoming->by(“details.date”)) {
}
The string expression should be evaluated for each item in the post collection and should hopefully return a sortable date string.
https://www.masterpressplugin.com/docs/developer/methods/woof-collection-by
Let me know if that works.
|
aguko
Post count: 43
|
Great!
I was able to rearrange in order of the field’s date.
Very Thanks.
|
traversal
Post count: 207
|
Superb, glad it worked! The sorting methods are pretty powerful 🙂
|
aguko
Post count: 43
|
While I used, I have noticed that order is not right.
But I succeeded, when correcting as follows.
foreach ($wf->the->incoming->by(“details.calendar.date” ,$order=”DESC”)) {
}
details: field set
calendar: field
date: data type
Thanks.
|
traversal
Post count: 207
|
All good – sorry I should have mentioned that you can indeed specify the sort order as well. Glad you got it working!
|