taxonomy sorts entries by term_id

[ad_1]

Hello @skscomp ,

Thank you very much for using our plugin. You have two alternatives, you can read the taxonomy terms by using the Database data-source, and including an ORDER BY clause in the query, or you can include a callback in the recordset field to sort the results in the client side after receive them as you prefer.

Please try the following example.

Create a form and enter the following structure:

<script>function my_sort(data){
data.sort((a,b)=>a.slug<b.slug?-1:(a.slug == b.slug ? 0 : 1));
return data;
}</script>
[select my_list]
[cf7-recordset id="my_recordset" type="taxonomy" taxonomy="category" attributes="term_id,name,slug" callback="my_sort"]
[cf7-link-field recordset="my_recordset" field="my_list" value="term_id" text="slug"]

The recordset field includes the callback attribute callback="my_sort" it takes the recordset records and sorts them by the slug term. The rest of the fields’ tags have the usual structure.

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer