Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

nextart on "[Plugin: Polylang] retrieve post language in back end"

$
0
0

with this function
$val = $_GET['new_lang'];
retrieve the slug of languages, then the function became:

add_filter( 'default_content', 'my_editor_content', 10, 2 );

function my_editor_content( $content, $post ) {
      $val = $_GET['new_lang'];
      if ($val=='en'){
   		switch( $post->post_type ) {

        case 'corso':
            $content = '';
        break;
        case 'olea':
            $content = '';
        break;
        default:
            $content = "<br><br><br>
			[tab name='SPECIFICATIONS']
			[/tab]
			[tab name='ADVANCED FEATURES']
			[/tab]
			[tab name='CLINICAL IMAGES']
			[/tab]
			[end_tabset]
			";
        break;
		}
	} else {
		switch( $post->post_type ) {
        case 'corso':
            $content = '';
        break;
        case 'olea':
            $content = '';
        break;
        default:
            $content = "<br><br><br>
			[tab name='CARATTERISTICHE TECNICHE']
			[/tab]
			[tab name='FUNZIONI AVANZATE']
			[/tab]
			[tab name='IMMAGINI CLINICHE']
			[/tab]
			[end_tabset]
			";
        break;
    }
}
    return $content;
}

bye Maurizio


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>