Created
April 24, 2019 21:28
-
-
Save robwent/f921db818921073aa454c06b87c94023 to your computer and use it in GitHub Desktop.
Extends Yoast schema to add event data
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 | |
include ("classes/Schema_Event.php"); | |
add_filter( 'wpseo_schema_graph_pieces', 'PREFIX_add_graph_pieces', 11, 2 ); | |
/** | |
* Adds Schema pieces to our output. | |
* | |
* @param array $pieces Graph pieces to output. | |
* @param \WPSEO_Schema_Context $context Object with context variables. | |
* | |
* @return array $pieces Graph pieces to output. | |
*/ | |
function PREFIX_add_graph_pieces( $pieces, $context ) { | |
$pieces[] = new Schema_Event( $context ); | |
return $pieces; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment