Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
Last active July 29, 2019 23:52
Show Gist options
  • Save bryanwillis/16f1755f07e507f2b3b6 to your computer and use it in GitHub Desktop.
Save bryanwillis/16f1755f07e507f2b3b6 to your computer and use it in GitHub Desktop.
This allows you to debug all of the known genesis attributes available for filtering. Genesis attributes are used for adding classes, schema.org markup, id's, and any other html attributes to elements. Drop this in your functions.php
<?php
/**
* Debug Genesis Attributes
* @author Bryan Willis
*/
add_action( 'wp_footer', 'debug_genesis_attr_filters' );
function debug_genesis_attr_filters()
{
global $wp_filter; // current_filter() might be a better way to do this
$genesis_attr_filters = array ();
$h1 = '<h1>Current Page Genesis Attribute Filters</h1>';
$out = '';
$ul = '<ul>';
foreach ( $wp_filter as $key => $val )
{
if ( FALSE !== strpos( $key, 'genesis_attr' ) )
{
$genesis_attr_filters[$key][] = var_export( $val, TRUE );
}
}
foreach ( $genesis_attr_filters as $name => $attr_vals )
{
$out .= "<h2 id=$name>$name</h2><pre>" . implode( "\n\n", $attr_vals ) . '</pre>';
$ul .= "<li><a href='#$name'>$name</a></li>";
}
print "$h1$ul</ul>$out";
}
genesis_attr_head
genesis_attr_body
genesis_attr_site-header
genesis_attr_site-title
genesis_attr_site-description
genesis_attr_header-widget-area
genesis_attr_breadcrumb
genesis_attr_breadcrumb-link-wrap
genesis_attr_search-form
genesis_attr_nav-primary
genesis_attr_nav-secondary
genesis_attr_nav-header
genesis_attr_nav-link-wrap
genesis_attr_nav-link
genesis_attr_structural-wrap
genesis_attr_content
genesis_attr_taxonomy-archive-description
genesis_attr_author-archive-description
genesis_attr_cpt-archive-description
genesis_attr_date-archive-description
genesis_attr_blog-template-description
genesis_attr_posts-page-description
genesis_attr_entry
genesis_attr_entry-image
genesis_attr_entry-image-widget
genesis_attr_entry-image-grid-loop
genesis_attr_entry-author
genesis_attr_entry-author-link
genesis_attr_entry-author-name
genesis_attr_entry-time
genesis_attr_entry-modified-time
genesis_attr_entry-title
genesis_attr_entry-content
genesis_attr_entry-meta-before-content
genesis_attr_entry-meta-after-content
genesis_attr_archive-pagination
genesis_attr_entry-pagination
genesis_attr_adjacent-entry-pagination
genesis_attr_comments-pagination
genesis_attr_entry-comments
genesis_attr_comment
genesis_attr_comment-author
genesis_attr_comment-author-link
genesis_attr_comment-time
genesis_attr_comment-time-link
genesis_attr_comment-content
genesis_attr_author-box
genesis_attr_sidebar-primary
genesis_attr_sidebar-secondary
genesis_attr_site-footer
genesis_attr_site-inner
genesis_attr_content-sidebar-wrap
genesis_attr_nav-footer
genesis_attr_jumbotron-header
genesis_attr_widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment