Title: This script blocks oEmbed
Last modified: August 20, 2016

---

# This script blocks oEmbed

 *  [LZL0](https://wordpress.org/support/users/lchief/)
 * (@lchief)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/this-script-blocks-oembed/)
 * How can this script block oEmbed?
    It is an auto-embed image script. It gets 
   the url of the image and converts it into an image.
 *     ```
       function content_magic($content) { 
   
       $content = get_the_content();
   
       $m= preg_match_all('!http://[a-z0-9\-\.\/]+\.(?:jpeg|jpg|png|gif)!Ui' , $content , $matches);
   
       if ($m) {
        $links=$matches[0];
        for ($j=0;$j<$m;$j++) {
        $content=str_replace($links[$j],'<img src="'.$links[$j].'">',$content);
        }
        }
   
        return $content;
        }
        add_filter('the_content','content_magic');
       ```
   
 * How can I solve this Problem?
    Thank you in advance, Chief

The topic ‘This script blocks oEmbed’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [LZL0](https://wordpress.org/support/users/lchief/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/this-script-blocks-oembed/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
