• Hello. I’m trying to register handler for “Non-oEmbed” videochart.net using this code in functions.php:

    wp_embed_register_handler( 'videochart', '#http://videochart\.net/video	/(.*)#i', 'wp_embed_handler_videochart' );
    function wp_embed_handler_videochart( $matches, $attr, $url, $rawattr ) {
    	$embed = sprintf(
    			'<iframe width="640" height="360" src="http://videochart.net/framevideo/'.esc_attr($matches[1]).'?width=640&height=360"  frameborder="0" allowfullscreen ></iframe>'
    			);
    	return apply_filters( 'embed_videochart', $embed, $matches, $attr, $url, $rawattr );
    }

    but then i pasting the link(f.e. http://videochart.net/video/80283.879240706fc86ae2cd7694409ac0 ) in editor – nothing happens.
    May be someone have an idea what’s going wrong?
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I deleted your other four posts about this. If your post doesn’t show up right away, just be patient and the moderators will clear it up for you.

    wp_embed_register_handler( 'videochart', '#http://videochart\.net/video	/(.*)#i', 'wp_embed_handler_videochart' );

    There’s a TAB in there between video and the /

    Try this?

    wp_embed_register_handler( 'videochart', '#http://videochart\.net/video/(.*)#i', 'wp_embed_handler_videochart' );

    Thread Starter dnbdnb

    (@dnbdnb)

    Unfortunately – no effect =(

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding embed support for a Non-oEmbed Site’ is closed to new replies.