A
A
Alexandra2021-10-24 15:06:52
WordPress
Alexandra, 2021-10-24 15:06:52

How to enable Option page translation (ACF) in WP multilang?

The site made options pages through Acf.
WP Multilang by description supports it. How can I connect the translation of Option page blocks?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Litvinenko, 2021-10-25
@Aleksa-s

We write in the function file something like

//На странице опций найти строку типа ["id"]=>string(36) "toplevel_page_theme-general-settings", строка может быть другой
function id_WPSE_114111() {
  echo "<pre>";
  var_dump(get_current_screen());
  echo "</pre>";
}
add_action( 'admin_notices', 'id_WPSE_114111' );

in the theme root in the wpm-config.json file,
add a line like
{
  "admin_pages": [
    "toplevel_page_theme-general-settings"
  ]
}

in the wpm-config.json file, it should turn out, taking into account custom post types and taxonomies, something like
{
  "post_types": {
    "portfolio": {},
    "events": {}
  },
  "taxonomies": {
    "portfolio-category": {},
    "portfolio-tag": {}
  },
  "options": {
    "theme_mods_my_theme": {
      "my_theme_custom_option": {}
    }
  },
  "admin_pages": [
    "toplevel_page_theme-general-settings"
  ]
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question