FEATURE Passing wpml lanugage to body
This commit is contained in:
parent
3d3c79cbd7
commit
5eb37595fa
|
|
@ -365,6 +365,31 @@ function add_custom_taxonomy_menu_item()
|
|||
}
|
||||
add_action('admin_menu', 'add_custom_taxonomy_menu_item');
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
Masquer le menu "Chantiers" pour les utilisateurs non autorisés
|
||||
--------------------------------------------------------------------------------------------*/
|
||||
function metiers_du_patrimoine_admin_classes($classes)
|
||||
{
|
||||
global $pagenow;
|
||||
|
||||
$currentLanguage = apply_filters('wpml_current_language', null);
|
||||
|
||||
if ($currentLanguage === 'fr') {
|
||||
$classes .= ' wpml-current-language--fr';
|
||||
} else {
|
||||
$classes .= ' wpml-current-language--nl';
|
||||
}
|
||||
|
||||
|
||||
if (in_array($pagenow, array('post.php', 'post-new.php'), true)) {
|
||||
$classes .= ' your-class';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter('admin_body_class', 'metiers_du_patrimoine_admin_classes');
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
Masquer le menu "Chantiers" pour les utilisateurs non autorisés
|
||||
--------------------------------------------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user