Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created January 27, 2021 17:02
Show Gist options
  • Save yousufansa/0bf3a36ecf982f8a5ab7860c35651113 to your computer and use it in GitHub Desktop.
Save yousufansa/0bf3a36ecf982f8a5ab7860c35651113 to your computer and use it in GitHub Desktop.
MAS Videos - Upload Date Structure Data Issue Fix
function masvideos_structured_data_video_object_upload_date( $data, $post_object ) {
$data['uploadDate'] = $post_object->get_date_created()->date( 'c' );
return $data;
}
add_filter( 'masvideos_structured_data_movie', 'masvideos_structured_data_video_object_upload_date', 10, 2 );
add_filter( 'masvideos_structured_data_video', 'masvideos_structured_data_video_object_upload_date', 10, 2 );
add_filter( 'masvideos_structured_data_tv_show', 'masvideos_structured_data_video_object_upload_date', 10, 2 );
add_filter( 'masvideos_structured_data_episode', 'masvideos_structured_data_video_object_upload_date', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment