create a shortcode with nested shordcodes conditional language
-
Hi everybody,
I’m working on a bilingual site. i have two forms one in french and one in english with those shortcodes.
So i tried to create a shortcode with nested shortcode conditional language but it doesn’t work.here my code in function.php:
<?php function getProjectForm_shortcode($atts, $content = ""){ $current_language = get_locale(); if( $current_language == 'en_EN' ){ if ($content) { /$content = do_shortcode("[{$content}]"); //here the shortcode [gravityform id="3" title="false"] } } if( $current_language == 'fr_FR' ){ if ($content) { $content = do_shortcode("[{$content}]"); //here the shortcode [gravityform id="4" title="false"] } } } add_shortcode( 'getProjectForm', 'getProjectForm_shortcode' ); ?>
And i put my shortcode [getProjectForm] in my page but nothing happen.
can you help me to solve this problem please
Big thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘create a shortcode with nested shordcodes conditional language’ is closed to new replies.