| 1 |
<?php |
| 2 |
|
| 3 |
// If this file is called directly, abort. |
| 4 |
if ( ! defined( 'WPINC' ) ) { |
| 5 |
die; |
| 6 |
} |
| 7 |
|
| 8 |
|
| 9 |
/** |
| 10 |
* wpLingua Shortcode : [wplng_notranslate] |
| 11 |
* |
| 12 |
* @param array $atts |
| 13 |
* @param string $content |
| 14 |
* @return string |
| 15 |
*/ |
| 16 |
function wplng_shortcode_notranslate( $atts, $content ) { |
| 17 |
|
| 18 |
$html = '<span class="notranslate">'; |
| 19 |
$html .= wp_kses_post( $content ); |
| 20 |
$html .= '</span>'; |
| 21 |
|
| 22 |
return $html; |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
/** |
| 27 |
* wpLingua Shortcode : [wplng_switcher] |
| 28 |
* |
| 29 |
* @param array $atts |
| 30 |
* @return string |
| 31 |
*/ |
| 32 |
function wplng_shortcode_switcher( $atts ) { |
| 33 |
|
| 34 |
$attributes = shortcode_atts( |
| 35 |
array( |
| 36 |
'insert' => false, |
| 37 |
'style' => false, |
| 38 |
'title' => false, |
| 39 |
'theme' => false, |
| 40 |
'flags' => false, |
| 41 |
'class' => false, |
| 42 |
), $atts |
| 43 |
); |
| 44 |
|
| 45 |
if ( ! empty( $attributes['class'] ) ) { |
| 46 |
$attributes['class'] .= ' insert-shortcode'; |
| 47 |
} else { |
| 48 |
$attributes['class'] = 'insert-shortcode'; |
| 49 |
} |
| 50 |
|
| 51 |
return wplng_get_switcher_html( $attributes ); |
| 52 |
} |
| 53 |
|