0

I'm trying to get kubity to embed via the wp_oembed_add_provider() function in the functions.php doc.

<?php 
// Register Kubity as an oEmbed provider
function kubity_oembed() {

    wp_oembed_add_provider( '#https?://(www\.)?kubity.com/p/.*#i', 'https://www.kubity.com/embed/', true );

}
add_action( 'init', 'kubity_oembed' );
?>

My question is whether I need to make my own json document and specify thumbnails and so on for this and if so, where would I put the URL for the JSON output?

About this Task:
* Client is set on only using Kubity to show their embedded objects on their wordpress site. * The embed code from kubity is an iframe.
* The theme of the website has an "portfolio" page which allows you to embed youtube/vimeo (basically anything that oembed standard protocols allow), into part of a slideshow/gallery with the page content.

Note: I've contacted the support providers for kubity but they've not got round to replying in a few days. I figured I'd put my hand to making it work without their support.

1 Answer 1

0

I had tried various attempts of putting my own local php json oembed output in order to structure the embeded data. However, I found the documentation became fruitless on this one, I wasn't clear how the provider and the response was to work.

I have worked around this with an if statement around the original oembed variable in the template.

N.B. this theme has a custom slideshow for posts with option for embedded videos, I was hoping to modify the oembed to handle custom urls but came short.

 if ( !empty( $video_url ) ) {  // existing code

    //detect if it is kubity URL
    if ( strpos( $video_url, 'kubity') !== false) {
        //get the serial of the attached url. 
        $kubitySerial = substr( strrchr( $video_url, '/' ), 1 );

    }
}

From this I can use the $kubitySerial in order to serialize the item into a friendly iframe embed url for Kubity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.