This hook allows you to modify the order of options in a Lookup field.
Usage
add_filter('frm_order_lookup_options', 'frm_set_custom_lookup_order', 20, 2);
Parameters
- $values (array): all of the options in the Lookup field
- $order (string): the order selected in the Lookup field's options
Examples
Basic example
The following is a basic example that shows how you can modify the order of options in a Lookup field.
add_filter('frm_order_lookup_options', 'frm_set_custom_lookup_order', 20, 2); function frm_set_custom_lookup_order( $values, $order ) { if ( $order == 'ascending' ) { sort( $values ); } return $values; }