function modify_post_content($content) {
// Check if it's not the WordPress admin area and not the editor
if (!is_admin() && !defined('DOING_AJAX')) {
// Get the current post ID
$post_id = get_the_ID();
// Check if the post has a video URL saved as post meta
$video_url = get_post_meta($post_id, 'plyr.link/p/player.html', true);
if (!empty($video_url)) {
// Append the video URL or iframe code to the post content
$content .= '';
$content .= '';
$content .= '
';
}
}
return $content;
}
// Add the filter to modify the post content
add_filter('the_content', 'modify_post_content');