Plugin Directory

Changeset 684872


Ignore:
Timestamp:
03/20/2013 05:43:44 PM (13 years ago)
Author:
itsalaska
Message:

Bug fix

Location:
child-page-navigation/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • child-page-navigation/trunk/child-page-navigation.php

    r684518 r684872  
    66    Author: ITS Alaska
    77    Author URI: http://ITSCanFixThat.com/
    8     Version: 1.3
     8    Version: 1.3.1
    99
    1010    This program is free software: you can redistribute it and/or modify
     
    3333    function form(){
    3434        $opts = get_option('widget_theme_navigation');
     35       
     36        $key = array_keys(array_flip($opts));
     37        unset($key['_multiwidget']);
     38        var_dump($key);
    3539      ?>
    36       <p>Title: <input name="cpn_title" id="cpn_title" type="text" <?php if(isset($opts[2]['title']) && $opts[2]['title'] != "") echo 'value="'.$opts[2]['title'].'"'; ?> /></p>
    37       <p>Sort by Sort Order? <input name="cpn_sort" id="cpn_sort" type="checkbox" <?php if(isset($opts[2]['sort']) && $opts[2]['sort']) echo 'checked="checked"'; ?> value="1" /></p>
     40      <p>Title: <input name="cpn_title" id="cpn_title" type="text" <?php if(isset($opts[$key]['title']) && $opts[$key]['title'] != "") echo 'value="'.$opts[$key]['title'].'"'; ?> /></p>
     41      <p>Sort by Sort Order? <input name="cpn_sort" id="cpn_sort" type="checkbox" <?php if(isset($opts[$key]['sort']) && $opts[$key]['sort']) echo 'checked="checked"'; ?> value="1" /></p>
    3842    <?php }
    3943
     
    5761        $opts = get_option('widget_theme_navigation');
    5862       
     63        $key = array_keys($opts);
     64        unset($key['_multiwidget']);
     65        $key = array_pop($key);
     66       
    5967        $page_arr = array('child_of' => $post->ID, 'parent' => $post->ID);
    6068       
    61         if($opts[2]['sort'])
     69        if($opts[$key]['sort'])
    6270            $page_arr['sort_column'] = 'menu_order';
    6371
     
    7381        echo $args['before_widget'];
    7482       
    75         if(isset($opts[2]['title']) && $opts[2]['title'] != "")
    76             echo $args['before_title'].$opts[2]['title'].$args['after_title'];
     83        if(isset($opts[$key]['title']) && $opts[$key]['title'] != "")
     84            echo $args['before_title'].$opts[$key]['title'].$args['after_title'];
    7785       
    7886        echo "<ul>";
  • child-page-navigation/trunk/readme.txt

    r684513 r684872  
    2121== Changelog ==
    2222
     23= 1.3.1 =
     24* Fixed weird bug where some users couldn't update their widget
     25
    2326= 1.3 =
    2427* Added option in widget to sort by page sort order
Note: See TracChangeset for help on using the changeset viewer.