-
-
Save KnowTheCodePro/433e60d14a655e48d4d7a8cd8be366f8 to your computer and use it in GitHub Desktop.
Demonstrating how to customize the attributes with genesis-parse-attr()
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_action( 'loop_start', __NAMESPACE__ . '\demo_sanitizing_html_class' ); | |
function demo_sanitizing_html_class() { | |
$attributes = array( | |
'id' => 'demo', | |
); | |
$attributes = genesis_parse_attr( 'know_the-code', $attributes ); | |
d( $attributes ); | |
} | |
add_filter( 'genesis_attr_know_the-code', __NAMESPACE__ . '\filter_attributes' ); | |
function filter_attributes( $attributes ) { | |
d( $attributes ); | |
unset( $attributes['class'] ); | |
return $attributes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment