Support

Account

Home Forums Backend Issues (wp-admin) The option page loses the field grouping after translation.

Solved

The option page loses the field grouping after translation.

  • Hey,

    I have found the following issue:

    This is a part of my option pages:

    
    acf_add_options_sub_page(array(
        'page_title'  	=> __( 'Theme Settings - General', 'textdomain' ),
        'menu_title'  	=> 'General',
        'parent_slug' 	=> 'theme-general-settings',
        'capability'  	=> 'edit_posts',
        'post_id'		=> 'options',
    ));
    

    I translate the 'menu_title' => 'General', e.g. to german via textdomain:

    'menu_title' => __( 'General', 'textdomain' ),

    After language switch in wp backend. I go to acf options page with the new label “Allgemein” in german. The result, the field groups are not found.

  • Hi @wootimes

    I believe that’s because you didn’t set the menu slug, so ACF will generate the slug from the “menu_title” option. A menu slug is like an options page ID for ACF, so it knows where to put the fields.

    So when you translated the menu title, the slug got changed also. To fix it, kindly add a “menu_slug” option like this:

    acf_add_options_sub_page(array(
        'page_title'  	=> __( 'Theme Settings - General', 'textdomain' ),
        'menu_title'  	=> 'General',
        'menu_slug'         => 'theme-general',
        'parent_slug' 	=> 'theme-general-settings',
        'capability'  	=> 'edit_posts',
        'post_id'		=> 'options',
    ));

    I hope this helps 🙂

  • @acf-support Oh yes, that’s it. Thank you 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘The option page loses the field grouping after translation.’ is closed to new replies.