shortcode para videos de tiktok
Código:
[tiktok video1="https://www.tiktok.com/@ermitacerrajero/video/7369637842030447904" video2="https://www.tiktok.com/@ermitacerrajero/video/7368136723336793376"][/tiktok]
Código:
function fnc_tiktok($args="")
{
$p = new sev();
$videos = shortcode_atts(['video1'=>NULL,'video2'=>NULL],$args);
$p->addVideo($videos['video2']);
$p->addVideo($videos['video1']);
$output=$p->render();
return $output[0];
}
Código:
class sev extends WP_oEmbed
{
public array $videos;
private $vCount = 0;
public function addVideo($url)
{
$this->videos[$this->vCount] = $this->get_data($url,"")->html;
$this->vCount++;
}
public function render()
{
foreach($this->videos as $v)
{
$vid[] = sprintf("<div class=\"miGaleria\">%s</div>",$v);
return $vid;
}
}
}
a ver si alguein me ilumina, gracias.