extraxt the content of shortcodes with preg_match_all + qtranslate

Hey everyone! I’ve create a function that would extract the content from shortcode from 3 different languages in Wordpress using qtranslate.

I manage to get English (the main language), but is shows nothing when extracting the Romanian and Russian (2nd and 3rd language) between [internet]…[/internet]

My code is:
[php]
function get_internet($my_post) {
$post_id = $my_post; //$_GET[“p”];
$queried_post = get_post($post_id);
$title = $queried_post->post_title;

    preg_match_all('#\[internet\](.+)\[\/internet\]#', $queried_post->post_content, $matches);
    echo 'EN: ' . $matches[1][0];
    echo 'RO: ' . $matches[1][1];
    echo 'RU: ' . $matches[1][2];

}[/php]

Is there something missing in my code?

Sponsor our Newsletter | Privacy Policy | Terms of Service