-
-
Save KnowTheCodePro/f9f5144bc2d527baf30a0167b9871f44 to your computer and use it in GitHub Desktop.
Adding a post ID data attribute to genesis_attr_entry
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 | |
namespace KnowTheCode; | |
add_filter( 'genesis_attr_entry', __NAMESPACE__ . '\change_entry_attributes', 99 ); | |
function change_entry_attributes( $attributes ) { | |
d( $attributes ); | |
$attributes['data-post-id'] = get_the_ID(); | |
d( $attributes ); | |
return $attributes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment