Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add the {$prefix}_sidebar_defaults and {$prefix}_sidebar_args hooks.

  • Loading branch information...
commit de90d6b864e5815a0a9b92275654e5babaf71c91 1 parent ddf525e
@justintadlock authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 functions/sidebars.php
View
6 functions/sidebars.php
@@ -52,12 +52,18 @@ function hybrid_register_sidebars() {
'after_title' => '</h3>'
);
+ /* Allow developers to filter the default sidebar arguments. */
+ $defaults = apply_filters( hybrid_get_prefix() . '_sidebar_defaults', $defaults, $sidebar );
+
/* Parse the sidebar arguments and defaults. */
$args = wp_parse_args( $core_sidebars[$sidebar], $defaults );
/* If no 'id' was given, use the $sidebar variable and sanitize it. */
$args['id'] = ( isset( $args['id'] ) ? sanitize_key( $args['id'] ) : sanitize_key( $sidebar ) );
+ /* Allow developers to filter the sidebar arguments. */
+ $defaults = apply_filters( hybrid_get_prefix() . '_sidebar_args', $defaults, $sidebar );
+
/* Register the sidebar. */
register_sidebar( $args );
}
Please sign in to comment.
Something went wrong with that request. Please try again.