Extract an embedded video from the content

Embeds are cached in hidden post meta fields with _oembed_* keys. You could retrieve all of meta (with get_post_custom() for example) and try to get info from it. However, from quick look at my test data it seems that duplicates are not uncommon there (might have to do with either WP version changes or embed … Read more

Hook WP_Embed run_shortcode

Hooks are only available when you see apply_filters, apply_filters_ref_array, do_action, and do_action_ref_array. They are all basically handled the same way but have some small differences like filters always expecting a returned value. e.g.: // seeing this in some WordPress code $the_content = apply_filters( ‘the_content’, $the_content ); // means you can then use something like this … Read more

Embed Youtube video link in wordpress editor

Try just pasting the YouTube URL in to the post or page in the text editor with-out embed code as an editor. See if that works never heard anyone having this problem… https://www.youtube.com/watch?v=VYmp9HmMYwU&t It’s super easy to embed videos, images, tweets, audio, and other content into your WordPress site. This feature was added in WordPress … Read more

YouTube embed parameters?

There’s always a filter you can use to hook into the output, see embed_oembed_html. Try this in a custom plugin or child theme’s functions file, it will add any other query strings to the iframe src attribute: add_filter(“embed_oembed_html”, function( $html, $url, $attr ) { parse_str(parse_url($url, PHP_URL_QUERY), $url); if ( $url ) { foreach ( $url … Read more

Responsive embed for the video shortcode

You could create a new callback for the embed_oembed_html filter and target the third input argument, the oembed $url. Then you could e.g. create boolean helper functions like (untested): function is_oembed_from_video_specific_hosts_wpse274552( $url ) { return in_array( parse_url( $url, PHP_URL_HOST ), [ ‘youtube.com’, ‘youtu.be’, ‘vimeo.com’, // … etc ], true ); } or a more detailed … Read more

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