Add parameter (time) to oembed

No extra code needed. Simply include the timestamp parameter onto the YouTube link, with the format of hash t equals number m number s. Or in other words: #t=1m02s The numbers are minutes and seconds. Example of a rickroll pre-fast-forwarded to 1 minute in: http://www.youtube.com/watch?v=dQw4w9WgXcQ#t=1m0s YouTube’s oEmbed endpoint seems to handle this just fine and … Read more

Video Embed with Captions in Turkish

Okay the thing is that the oembed endpoint seems not to support any other than the default parameters. So it seems that all you can do is parse the response and add in your parameters to the iframe src. This should do it (untested) function wpse_218836_add_youtube_parameter( $return, $data, $url ){ if ( $data->provider_name === ‘YouTube’){ … Read more

Instagram URL is converted into oEmbed

Figured it out. Embed shortcode stores the oemebd data as post meta using md5 hash. wp-includes/class-wp-embed.php // Check for a cached result (stored in the post meta) $key_suffix = md5( $url . serialize( $attr ) ); $cachekey = ‘_oembed_’ . $key_suffix; $cachekey_time=”_oembed_time_” . $key_suffix; And has a cache mechanism to fetch new data only after … Read more

Is there a built in function to see if a URLis oEmbed Compatible?

wp-includes/class-oembed.php has a public variable $providers. So you can build a small function to get all of them: function list_oembed_providers( $print = TRUE ) { require_once( ABSPATH . WPINC . ‘/class-oembed.php’ ); $oembed = _wp_oembed_get_object(); $print and print ‘<pre>’ . htmlspecialchars( var_export( $oembed->providers, TRUE ) ) . ‘</pre>’; return $oembed->providers; } If you call this … Read more

oEmbed not recognising Vimeo URLs

Looking into WordPress Core vimeo is registered like so: ‘#http://(www\.)?vimeo\.com/.*#i’ => array( ‘http://www.vimeo.com/api/oembed.{format}’, true ), But looking at vimeo API for oEmbed they show their URL without the www. so what you need to do is register vimeo oEmbed correctly: add_action( ‘init’, ‘add_vimeo_oembed_correctly’ ); function add_vimeo_oembed_correctly() { wp_oembed_add_provider( ‘#http://(www\.)?vimeo\.com/.*#i’, ‘http://vimeo.com/api/oembed.{format}’, true ); } You can … Read more

extra text in Vimeo Embedded videos

I add a frame ID using an each function’s index, and then appending the src with the string you need: jQuery(‘#video-gallery-list li.video-player’).each(function(i) { // set up a variable for the src that includes the new unique ID you’re about to use var this_src = jQuery(this).find(‘iframe’).attr(‘src’) + ‘?api=1&amp;player_id=player_’+i; jQuery(this).find(‘iframe’).attr(‘ID’, ‘player_’+i).attr(‘src’,this_src); });

How to center oEmbedded content

After some Googling, I found a solution that was originally done for a Twitter embed, but I modified it to work with all oEmbed contents. Keep in mind that for this to work on existing posts, you’ll need to do an “update” for the oEmbed content to refresh from the cache. add_filter(‘oembed_result’,’center_oembed’,10,3); function center_oembed($html, $url, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)