Clique aqui para ver o código em PHP

function youtubedownload() {

?>
<div class=”whatsapp”>
<form action=”#” method=”get”>
<input type=”text” name=”numero” placeholder=”Insira o endereço do vídeo do youtube aqui”>
<input type=”submit” value=”Preparar Download”>
</form>

<?php if(!isset($_GET[‘numero’])){}else{

global $wpdb;
$video = $_GET[‘numero’];
$result = str_replace(“ube”, “”, $video);

if($wpdb->insert(‘youtube’, array(
‘video’ => $result
)
)){
echo “Preparar Download…!”;}else{echo “falhou”;}
?>

<script>

window.onload = function(){
window.open(“<?php echo $result; ?>”, “_self”); // will open new tab on window.onload
}
</script><?
}
echo “</div>”;
}
add_shortcode( ‘youtubedownload’, ‘youtubedownload’ );