WordPress.org

Plugin Directory

Changeset 591649


Ignore:
Timestamp:
08/29/12 01:33:33 (20 months ago)
Author:
andrewryno
Message:

When creating the first sidebar, fix bug where count was set to 2, meaning all subsequent sidebars didn't save.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • unique-page-sidebars/trunk/unique-page-sidebars.php

    r479425 r591649  
    55Description: Allows for the creation of sidebars on a per-page basis all from a single dynamic_sidebar() call from where they should appear. 
    66Author: Andrew Ryno 
    7 Version: 0.1 
     7Version: 0.2 
    88Author URI: http://andrewryno.com/ 
    99*/ 
     
    246246    if ( isset( $input['add_sidebar'] ) ) { 
    247247        $sidebars = get_option( 'ups_sidebars' ); 
    248         if ( '' != $input['add_sidebar'] ) { 
    249             $sidebar_num = count( $sidebars ) + 1; 
     248        if ( ! empty( $input['add_sidebar'] ) ) { 
     249            if ( is_array( $sidebars ) ) { 
     250                $sidebar_num = count( $sidebars ) + 1; 
     251            } else { 
     252                $sidebar_num = 1; 
     253            } 
     254 
    250255            $sidebars['ups-sidebar-' . $sidebar_num] = array( 
    251256                'name' => esc_html( $input['add_sidebar'] ), 
Note: See TracChangeset for help on using the changeset viewer.