WordPress.org

Ready to get started?Download WordPress

Forums

Non-OEmbed code not working (1 post)

  1. Jon Breitenbucher
    Member
    Posted 2 years ago #

    I have copied the code below from a working embed plugin that I wrote and changed the regex to what this service requires and changed the embed to match what the service generates. However the plugin acts like the post content is not being filtered at all. I verified that the regex is matching what I want it to match using a regex checker service. I have tried simplifying the regex and embed to something like #dog/(.+)# and hello %1$s and it doesn't replace dog/abd with hello abd. I'm stumped.

    wp_embed_register_handler( 'woosterembed', '#rtmp://adobeflash\.wooster\.edu/vod/(.+)#', 'wp_embed_handler_woosterembed' );
    
    function wp_embed_handler_woosterembed( $matches, $attr, $url, $rawattr ) {
    
    	$embed = sprintf(
    			'<object id="flowplayer" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" data="http://webapps.wooster.edu/player/swf/flowplayer.swf" type="application/x-shockwave-flash"><param name="movie" value="http://webapps.wooster.edu/player/swf/flowplayer.swf" /><param name="allowfullscreen" value="true" /><param name="flashvars" value=\'config={"key":"#$28d4f4f3f205e518e4a","clip":{"provider":"rtmp","live":true,"url":"mp4:%1$s","autoBuffering":true,"autoPlay":false},"plugins":{"rtmp":{"url":"flowplayer.rtmp.swf","netConnectionUrl":"rtmp://adobeflash.wooster.edu/vod"}}}\' /></object>',
    			esc_attr($matches[1])
    			);
    
    	return apply_filters( 'embed_woosterembed', $embed, $matches, $attr, $url, $rawattr );
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Jon Breitenbucher
  • This topic is not resolved
  • WordPress version: 3.2.1

Tags