Title: WP stripping Embedded code?
Last modified: August 19, 2016

---

# WP stripping Embedded code?

 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/wp-stripping-embedded-code/)
 * 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](http://digitalraindrops.pastebin.com/Txz4zZXn)
 * Thanks
 * David

Viewing 1 replies (of 1 total)

 *  Thread Starter [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/wp-stripping-embedded-code/#post-1889944)
 * 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](http://digitalraindrops.net/facebook-minisite/),
   and you can see the conversion for the FBML code to embed the video on line 56.
 * [http://digitalraindrops.pastebin.com/QqAKV2a1](http://digitalraindrops.pastebin.com/QqAKV2a1)
 * David

Viewing 1 replies (of 1 total)

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

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 1 participant
 * Last reply from: [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/wp-stripping-embedded-code/#post-1889944)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
