public function addSidebars($configs)
    {
        // Define defaults
        $default = [
            'name'          => Translate::t('configuration.sidebar.name'),
            'id'            => '',
            'description'   => '',
            'class'         => '',
            'before_widget' => '',
            'after_widget'  => '',
            'before_title'  => '',
            'after_title'   => '',
        ];

        // Check
        if (empty($configs)) {
            return;
        }

        // Iterate on configs
        foreach ($configs as $key => $props) {
            $props = !is_array($props) ? [$props] : $props;

            // Set id
            $props['id'] = isset($props['id']) && !empty($props['id']) ? $props['id'] : $key;

            // Set props
            $props = array_merge($default, $props);

            // Register sidebar
            register_sidebar($props);
        }
    }
public function addSidebars($configs)
    {
        // Define defaults
        $default = [
            'name'          => Translate::t('configuration.sidebar.name'),
            'id'            => '',
            'description'   => '',
            'class'         => '',
            'before_widget' => '',
            'after_widget'  => '',
            'before_title'  => '',
            'after_title'   => '',
        ];

        // Check
        if (empty($configs)) {
            return;
        }

        // Iterate on configs
        foreach ($configs as $key => $props) {
            $props = !is_array($props) ? [$props] : $props;

            // Set id
            $props['id'] = isset($props['id']) && !empty($props['id']) ? $props['id'] : $key;

            // Set props
            $props = array_merge($default, $props);

            // Register sidebar
            register_sidebar($props);
        }
    }
public function addSidebars ( $ configs ) { // Define defaults $ default = [ 'name' => Translate :: t ( 'configuration.sidebar.name' ) , 'id' => '' , 'description' => '' , 'class' => '' , 'before_widget' => '' , 'after_widget' => '' , 'before_title' => '' , 'after_title' => '' , ] ; // Check if ( empty ( $ configs ) ) { return ; } // Iterate on configs foreach ( $ configs as $ key => $ props ) { $ props = ! is_array ( $ props ) ? [ $ props ] : $ props ; // Set id $ props [ 'id' ] = isset ( $ props [ 'id' ] ) && ! empty ( $ props [ 'id' ] ) ? $ props [ 'id' ] : $ key ; // Set props $ props = array_merge ( $ default , $ props ) ; // Register sidebar register_sidebar ( $ props ) ; } }
Register sidebars to WP.

@param array $configs
Register sidebars to WP .