Extract links inside embed tags in WordPress

No need to use regex. WordPress has a handy function to strip shortcodes from a string. Use strip_shortcodes( $content ). So in your case, $content = “”; $your_clean _url = strip_shortcodes( $content ); echo $your_clean_url; // should output https://www.youtube.com/watch?v=Z9QbYZh1YXY EDIT Here’s a function (tested) that will remove your “unwanted” shortcode, and any other one. function … Read more

Get youtube link title in post title

Use the following code into your functions.php file. function change_title_yt( $post_id ) { $current_title = $_POST[‘post_title’]; $doc = new DOMDocument(); $doc->preserveWhiteSpace = FALSE; $doc->loadHTMLFile($current_title); $title_div = $doc->getElementById(‘eow-title’); $title = $title_div->nodeValue; $my_args = array( ‘ID’ => $post_id, ‘post_title’ => $title ); if ( ! wp_is_post_revision( $post_id ) ){ // unhook this function so it doesn’t loop … Read more

WordPress and Youtube problem

Try embedding an iFrame. Go to the youtube video you’re trying to post. Click right > Copy embed code. Paste it in the HTML editor on wordpress. It should work without a plug in.

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