Skip to content

Instantly share code, notes, and snippets.

@RiodeJaneiroo
Last active October 23, 2018 10:46
Show Gist options
  • Save RiodeJaneiroo/1d361eddf3234d2b8823991ed2e5af25 to your computer and use it in GitHub Desktop.
Save RiodeJaneiroo/1d361eddf3234d2b8823991ed2e5af25 to your computer and use it in GitHub Desktop.
[Lang site] #wordpress #polylang
define('SITE_LANG', pll_current_language('slug'));
if (function_exists('pll_register_string')) {
pll_register_string('Chat with us', 'Discute avec nous', 'Theme');
}
// for custom post type add lang
add_filter( 'pll_get_post_types', 'add_cpt_to_pll', 10, 2 );
function add_cpt_to_pll( $post_types, $is_settings ) {
$post_types['portfolio'] = 'portfolio';
return $post_types;
}
acf_add_options_page(array(
'page_title' => 'Site Options',
'menu_title' => 'Site Options',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
'post_id' => 'en',
'redirect' => false
));
acf_add_options_sub_page( array(
'page_title' => 'Site Options (FR)',
'menu_title' => __('Site Options (FR)', 'text-domain'),
'menu_slug' => "site-options-fr",
'post_id' => 'fr',
'parent' => 'theme-general-settings'
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment