[buddypress-trac] [BuddyPress Trac] #5472: xprofile_insert_field -> type - 'option' not allowed?
buddypress-trac
noreply at wordpress.org
Sun Jun 15 18:20:19 UTC 2014
#5472: xprofile_insert_field -> type - 'option' not allowed?
------------------------------+---------------------------
Reporter: shanebp | Owner: boonebgorges
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 2.1
Component: XProfile | Version: 1.9.2
Severity: normal | Resolution:
Keywords: needs-unit-tests |
------------------------------+---------------------------
Comment (by shanebp):
>I tested your script using option_order instead of field_order when
inserting country names, and it appears to work fine. Have you tested
this?
Yes. The option_order value for all rows is 0.
I believe due to BP_XProfile_Field::save() check re supports_options
But this works:
- set the Parent 'order_by' to 'custom'
- use array_reverse in the foreach options loop
- don't bother with field_order or option_order in the loop
Then the display order is preserved even if you delete the whole field and
run the script again.
I've updated the gist:
https://gist.github.com/shanebp/119ffd879acc56c324ab
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5472#comment:16>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list