Created
April 26, 2018 15:57
-
-
Save allysonsouza/e9191679d601449d8b7231d40a06175f to your computer and use it in GitHub Desktop.
Creating fields for each language in customizer with Kirki and WPML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( function_exists( 'icl_get_languages' ) ) { | |
$languages = icl_get_languages( 'skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str'); | |
} | |
if( !empty( $languages ) ) { | |
foreach( array_reverse( $languages ) as $lang ) { | |
Kirki::add_field( 'daibase', array( | |
'settings' => 'field_' . $lang['code'], | |
'label' => esc_attr__( 'Selo', 'textdomain' ), | |
'section' => 'home_' . $lang['code'], | |
'type' => 'image', | |
'priority' => 10, | |
) ); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment