• I am writing a plugin to create Facebook templates from WordPress, when I save embedded code into an option, it Looks like WordPress is stripping out the code.

    This is not about embedding into WordPress as the plugin has to create the code for a Facebook Template in HTML and or FBML.

    $layout = $layout .'<div class="youtube-video" '.$style.'>' ."\n";
    $layout = $layout .'<ul>' ."\n";
    $layout = $layout .'<li>' ."\n";
    $layout = $layout .'<object width="'.$width.'" height="'.$height.'"><param name="movie" value="http://www.youtube.com/v/'.$newcontent['column-video-'.$counter].'&hl=en&fs=1&rel=0&border=1"></param>' ."\n";
    $layout = $layout .'<param name="allowFullScreen" value="true"></param>' ."\n";
    $layout = $layout .'<param name="allowscriptaccess" value="always"></param>' ."\n";
    $layout = $layout .'<embed src="http://www.youtube.com/v/'.$newcontent['column-video-'.$counter].'&hl=en&fs=1&rel=0&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$width.'" height="'.$height.'"></embed>' ."\n";
    $layout = $layout .'</object>' ."\n";
    $layout = $layout .'</li>' ."\n";
    $layout = $layout .'</ul>' ."\n";
    $layout = $layout .'</div>' ."\n";

    This just saves in the option as:

    <div class="youtube-video" style="">
    <ul>
    <li>
    
    </li>
    </ul>
    </div>

    I have tried it local and online with the same result, anyone have any ideas, the pluging needs to write the youtube script to html and fbml.

    It could be a roles and resposibilities thing, currentluy I am using ‘edit_theme_options’ as I am using the wp_options and admin pages.

    More of the function on pastebein: http://digitalraindrops.pastebin.com/Txz4zZXn

    Thanks

    David

Viewing 1 replies (of 1 total)
  • Thread Starter Digital Raindrops

    (@adeptris)

    I have managed to sort this one with PHP calls, this may help someone as it drove me mad, and set me back a day!.

    As I am creating a html and fbml code I only needed:
    $layout= '<iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/_GOivlu6JoA" frameborder="0" allowFullScreen></iframe>';
    Storing:

    update_option( 'my-html', htmlspecialchars($layout) );

    The text may have mixed embeded code and links etc:

    Geting it back:

    $layout = stripslashes( html_entity_decode( get_option('my-html') ) );

    As an example the pastebin code was created by the plugin I am working on, and you can see the conversion for the FBML code to embed the video on line 56.

    http://digitalraindrops.pastebin.com/QqAKV2a1

    David

Viewing 1 replies (of 1 total)

The topic ‘WP stripping Embedded code?’ is closed to new replies.