The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Forms table default sort
New to formidable, looking for a way to set a default sort on the Forms table in the dashboard (the table that shows all forms created). When the forms table loads it sorts by date ascending (oldest first). I'd prefer it to show by date descending (so the newest forms are first).
I've searched the forum here and looked through the documentation and settings in WordPress and I don't see how to do this.
January 16, 2019 at 9:12 am
Sorting is a WordPress function. If you hover your mouse over any links in the header such as Form Title, Key or Date, you'll see an arrow head appear next to the word. This means you can sort on that column. Just click the clink. They are all toggles. This holds true for any WordPress screen that display all records of the same type such as pages and posts.
Setting a sort order as a default is much more complicated and requires custom coding. Maybe this will help you: https://wordpress.stackexchange.com/questions/194572/how-do-i-set-the-default-admin-sort-order-for-a-custom-post-type-to-a-custom-col
January 16, 2019 at 9:42 am
Thank you @vfontjr. Yes, I was aware of how to sort, I was just finding it tedious that I have to click the "date" sort twice each time I first view the page so I can see the newest form.
I ended up finding the location in the source code that set this (FrmFormsListHelper.php) and made the change there. By default it was using name of the form ASC. Changed it to created_at DESC.
$orderby = self::get_param(
array(
'param' => 'orderby',
'default' => 'created_at',
)
);
$order = self::get_param(
array(
'param' => 'order',
'default' => 'DESC',
)
);
I know this is not ideal. I also noticed there were no hooks in the file that would allow someone to override this functionality.
January 16, 2019 at 11:52 am
I hope you realize that the next Formidable update that is released will override what you've done. As long as you change the plugin source code, you'll either have to not update the plugin at all or continue to apply your change after every update.
January 16, 2019 at 1:11 pm
Yes, I do realize that it will be overridden. Given that it's a small change I can easily update it to include my fix after the plugin is updated.
Discussion closed.