Created
September 11, 2015 09:45
-
-
Save crumina/c1e515aecd3dce31c32c to your computer and use it in GitHub Desktop.
[Embrace] WPML - default language switcher
This file contains hidden or 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
if ( ! function_exists( 'reactor_toplang_r' ) ) { | |
function reactor_toplang_r( $args = '' ) { | |
if ( function_exists( 'icl_get_languages' ) ) { | |
$defaults = array( | |
'side' => 'right', | |
); | |
$args = wp_parse_args( $args, $defaults ); | |
$args = apply_filters( 'reactor_top_bar_args', $args ); | |
$output = '<div class="' . $args['side'] . '">' . do_action('wpml_add_language_selector') . '</div>'; | |
} | |
return apply_filters( 'reactor_toplang_r', $output ); | |
} | |
} | |
if ( ! function_exists( 'reactor_toplang_l' ) ) { | |
function reactor_toplang_l( $args = '' ) { | |
if ( function_exists( 'icl_get_languages' ) ) { | |
$defaults = array( | |
'side' => 'left', | |
); | |
$args = wp_parse_args( $args, $defaults ); | |
$args = apply_filters( 'reactor_top_bar_args', $args ); | |
$output = '<div class="' . $args['side'] . '">' . do_action('wpml_add_language_selector') . '</div>'; | |
return apply_filters( 'reactor_toplang_l', $output ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment