Created
August 30, 2013 18:38
-
-
Save brycejacobson/6392986 to your computer and use it in GitHub Desktop.
Genesis custom context with filter and callback to append the custom attributes.
This file contains hidden or 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 | |
add_filter( 'genesis_attr_movie', 'custom_add_movie_attr' ); | |
/** | |
* Callback for dynamic Genesis 'genesis_attr_$context' filter. | |
* | |
* Add custom attributes for the custom filter. | |
* | |
* @param array $attributes The element attributes | |
* @return array $attributes The element attributes | |
*/ | |
function custom_add_movie_attr( $attributes ){ | |
// add itemscope | |
$attributes['itemscope'] = ''; | |
// add the Movie itemtype schema | |
$attributes['itemtype'] = 'http://schema.org/Movie'; | |
// return the attributes | |
return $attributes; | |
} |
This file contains hidden or 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 | |
genesis_markup( array( | |
'html5' => '<div %s>', | |
'xhtml' => '<div>', | |
'context' => 'movie' | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment