Last active
August 14, 2016 18:19
-
-
Save inetbiz/9ee44c390ae426cdef730f8a00b56b8d to your computer and use it in GitHub Desktop.
Bug fix for Ultimate Video SEO Plugin for Wordpress https://www.denverprophit.us/wordpress/ultimate-video-seo-plugin-for-wordpress-bug-fix/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File Location /public_html/wp-content/plugins/ultimate-video-seo/classes/pvs_schema_markup_class.php | |
class pvs_schema_markup_class { | |
public function __construct() { | |
global $pvs_options; | |
if (!isset($pvs_options['pvs_rich']) ) { | |
add_action('the_content', array(&$this, 'pvs_schema_markup_function')); | |
} | |
} | |
public function pvs_schema_markup_function($content) { | |
global $post; | |
$thumbloc = get_post_meta( $post->ID, 'thumbloc', true ); | |
$thumbtitle = get_post_meta( $post->ID, 'thumbtitle', true ); | |
$thumbdesc = get_post_meta( $post->ID, 'thumbdesc', true ); | |
$thumbplayer = get_post_meta( $post->ID, 'thumbplayer', true ); | |
$thumbduration = get_post_meta( $post->ID, 'thumbduration', true ); | |
$family = get_post_meta( $post->ID, 'family', true ); | |
$thumbpubdate = get_post_meta( $post->ID, 'thumbpubdate', true ); | |
$pvsdisable = get_post_meta( $post->ID, 'pvsdisable', true ); | |
if (((is_single()) || (is_page())) && ($thumbloc !='') && ($pvsdisable != "yes")) { | |
$extra_content='<div itemprop="video" itemscope itemtype="https://schema.org/VideoObject" style="display:none;" > | |
<h2>Video: <span itemprop="name">'.$thumbtitle.' </span></h2> | |
<meta itemprop="duration" content="'.$thumbduration.'" /> | |
<meta itemprop="embedUrl" content="'.$thumbplayer.'" /> | |
<span itemprop="description">'.$thumbdesc.'</span> | |
<meta itemprop="uploadDate" content="'.$thumbpubdate.'"> | |
<meta itemprop="thumbnailUrl" content="'.$thumbloc.'"> | |
</div>'; | |
$content .= $extra_content; | |
} | |
return $content; | |
} | |
} | |
new pvs_schema_markup_class(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment