Open bryanwillis opened 8 years ago
This is the default Genesis behavior everything else is layered on top. As your notes above indicate, this may be preferable to bsg-add-class
.
You make an excellent point that there may not be any real value in this filter since the corresponding genesis_attr_
filter can be used instead. We should reconsider example number 2 on https://github.com/salcode/bootstrap-genesis/wiki/Hide-Primary-Sidebar-on-XS-Screen-Size and probably refactor it to use genesis_attr_sidebar-primary
instead.
However, even if we modify documentation to recommend against using this filter, I think it makes sense to keep it around.
This is the filter I use most often. The default Bootstrap values are assigned here and then these can be modified (as we do in bootstrap-markup-layout-options.php). I find this particularly useful for overwriting (rather than adding to) the default values.
In regard to the custom attributes, here's a handy function I wrote to return the current genesis_attributes
to add to the bsg-classes-to-add
array.
if( current_user_can('administrator') ) {
add_action( 'wp_footer', 'bsg_list_genesis_attr_filters' );
}
function bsg_list_genesis_attr_filters() {
global $wp_filter;
$genesis_attr_filters = array();
$output = '<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 ) {
$name = str_replace("genesis_attr_","",$name);
$output .= "<li>$name</li>";
}
print "$output</ul>";
}
Output
head
body
site-header
site-title
site-description
header-widget-area
breadcrumb
breadcrumb-link-wrap
search-form
nav-primary
nav-secondary
nav-header
nav-link-wrap
nav-link
structural-wrap
content
taxonomy-archive-description
author-archive-description
cpt-archive-description
date-archive-description
blog-template-description
posts-page-description
entry
entry-image
entry-image-widget
entry-image-grid-loop
entry-author
entry-author-link
entry-author-name
entry-time
entry-modified-time
entry-title
entry-content
entry-meta-before-content
entry-meta-after-content
archive-pagination
entry-pagination
adjacent-entry-pagination
comments-pagination
entry-comments
comment
comment-author
comment-author-link
comment-time
comment-time-link
comment-content
author-box
sidebar-primary
sidebar-secondary
site-footer
site-inner
content-sidebar-wrap
nav-footer
widget
This isn't really an issue but a question I had Sal or someone else that might know. I'm not is the value of the
bsg-add-class
filter compared tobsg-classes-to-add
or the standardgenesis_attr_{$context}
. Referring to this wiki, these examples below all seem to work the same with the exception ofbsg-add-class
only able to add one class, so I'm just wondering when to use each?