Skip to content

Instantly share code, notes, and snippets.

@inetbiz
Last active August 14, 2016 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inetbiz/9ee44c390ae426cdef730f8a00b56b8d to your computer and use it in GitHub Desktop.
Save inetbiz/9ee44c390ae426cdef730f8a00b56b8d to your computer and use it in GitHub Desktop.
<?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