Комментарии:
That's simply not a solution. You just get back to using a Page as I use to do ten years ago.
ОтветитьDid somewhat the same but made a CPT "Settings". Add as many "pages" there as you want and treat them as Options pages.
Next up query that specific page and get the fields.
public function settings()
{
// Get theme-settings page
$settings_page = get_page_by_path('theme-settings', null, 'settings');
// Get the page for the correct language
$get_translated_id = apply_filters('wpml_object_id', $settings_page->ID, 'settings');
return get_fields($get_translated_id);
}
Inside the Sage 9 Blade Controller let's me use $settings['custom_field'] anywhere in the theme.
Then just make a link in the menu to that specific post, put it on private and voila you have a settings screen which works.
I have the solution for you. How can I share you this ?
ОтветитьOK, so it is not me :) I had the same nightmare, and came up with the same solution. I registered a new post type for this to separate that page from the rest of the normal pages.
ОтветитьThanks That's useful!
ОтветитьStrange, when I change languages, the fields from the options page do switch correctly to the correct translated fields. What doesn't work is when I modify or add fields, the copy content from EN button is disabled. You have to manually make the same changes to the duplicated field group. I suppose I could use the overwrite button though. Also, the json field syncing seems to mess up quite a bit.
ОтветитьGreat !
tks you so much !