Вопрос

I have a custom meta box set up that allows users to paste the Youtube URL of a video so that it can be embedded into a post/page.

The meta box can be repeated so that a user can add as few or as many URL's as they wish so I'm using this code snippet to display each as a list item;

<?php
    $video = get_post_meta($post->ID, 'youtube-url');
    foreach ($video as $vid) {
        echo '<li>'.$vid.'</li>';
    }
?>

Is there a way that I can run the_content filter on each individual list item so that I can make use of oEmbed that is shipped with Wordpress?

Or perhaps there's a more efficient way...

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с wordpress.stackexchange
scroll top