@Trevor I think I am explaining it wrong. I am not looking to change to order of the posts, I want to change the order of a specific S&F filter that I created using the S&F admin tools which is a list of checkboxes.
This is what the field in S&F looks like
And here is the filter on the front end of my site
With CSS I already add icons for each item in the filter and that is the correct order. Now I need to hook in to the filter and change the order so that it is the same as in my admin, but I have no idea how to do that.
I think I need the sf_input_object_pre
filter and I already have this code
function filter_function_name($input_object, $sfid) {
if($input_object['name'] == '_sfm_category') {
$input_object['attributes']['class'] = 'my-test-class';
return $input_object;
}
return $input_object;
}
add_filter('sf_input_object_pre', __NAMESPACE__ . '\\filter_function_name', 10, 2);
It took me an hour to figure out how I would get this name _sfm_category
from my field category
. It would be great if you could edit the docs and tell there
If you are looking for your specific $input_object['name']
open your web inspector and look for the data attribute data-sf-field-name="_sfm_YOUR-FIELD-NAME"