'h3', 'wrap' => 'div', 'before_widget' => '<# id="%1$s" class="widget %2$s">', 'after_widget' => '', 'before_title' => '<# class="widget-title">', 'after_title' => '' ); public static function init() { if(self::$initialized){return;} //Do not run twice /* add has- classes to the body */ add_filter('body_class', function ($classes) { $classes = (array) $classes; $classes = array_merge($classes, self::classes()); return array_unique($classes); }, 1); self::$initialized = true; } /** * Registers a sidebar/widget position. * @param $options (array) An associative array of options for the widget position. * @void */ public static function register($options = array()) { self::init(); //Runs only once even if called multiple times $settings = array_merge(self::$defaults, $options); //overwrite header/wrap settings over the default before/after settings. $settings['before_widget'] = str_replace('<#', '<' . $settings['wrap'], $settings['before_widget']); $settings['after_widget'] = str_replace('