Home › Forums › Backend Issues (wp-admin) › Alter field group settings per content type › Reply To: Alter field group settings per content type
Hi John. Thanks for jumping in. We’re using a custom plugin to include the json save and load.
function ts_acf_json_load( $paths ) {
$paths[] = trailingslashit( WP_CONTENT_DIR ) . 'acf-json';
return $paths;
}
add_filter( 'acf/settings/load_json', 'ts_acf_json_load' );
Then, in the functions.php within the theme, we have this code to alter it for a specific post type.
function toind_get_flexible_content( $field_group ) {
if ( 'group_5c76d2e8213cf' === $field_group['key'] && 'event' == $GLOBALS['post_type'] ) {
$field_group['menu_order'] = 7;
$field_group['position'] = 'normal';
}
return $field_group;
}
add_filter( 'acf/get_field_group', 'toind_get_flexible_content' );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.