Hi,
Is there a way to select by default the horizontal display of custom multiples fields in the back office ?
Sincerely,
Quentin

Minesh
Supporter
Les langues:
Anglais (English )
Fuseau horaire:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
There is no master setting available to change how Repeating Field Groups are displayed. I think it should be added and for that I suggest you should raise your voice by filing a new feature request using the following link:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
However - I think I am able to find a workaround that will help you to resolve your issue.
Can you please try to add the following filter code to your theme's functions.php file:
add_filter('admin_url','func_display_rfg_horizontal_by_default');
function func_display_rfg_horizontal_by_default( $link ) {
global $post_type;
//// replace your post type slug
$list_of_post_types = array('student','post','page');
if(in_array( $post_type, $list_of_post_types )) {
$params['rgview'] = 'horizontal';
$link = add_query_arg( $params, $link );
}
return $link;
}
Hello Minesh,
Thank you for your quick feedback.
I'm not sure if your function works...
When I added a new page, or a new article, by default the field was always in vertical mode.
On the other hand, once I've clicked on the horizontal display button (burger) for this new article, if I ask again for the creation of a new article, it opens in horizontal mode, but this may be due to the fact that I had just specified this horizontal view.
To sum up, I don't think the function manages to systematically apply the default Horizontal view mode to the consultation/creation of a new page.
Quentin
Well - As shared there is no such option available but I shared workaround.
Here is a sandbox site and you can auto-login to it using the following link:
- lien caché
I've added the same code I shared to you on "Custom Code" section:
- lien caché
When I add/edit the gym post type post:
- lien caché
I can see the URL param is added rgview=horizontal:
- wp-admin/post-new.php?post_type=gym&rgview=horizontal
have you modified the code and adjusted the post type slug with the variable:
//// replace your post type slug
$list_of_post_types = array('student','post','page');