Skip to content

Instantly share code, notes, and snippets.

@KnowTheCodePro
Created April 10, 2016 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KnowTheCodePro/433e60d14a655e48d4d7a8cd8be366f8 to your computer and use it in GitHub Desktop.
Save KnowTheCodePro/433e60d14a655e48d4d7a8cd8be366f8 to your computer and use it in GitHub Desktop.
Demonstrating how to customize the attributes with genesis-parse-attr()
<?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