Plugin Directory

Changeset 684879


Ignore:
Timestamp:
03/20/2013 06:04:54 PM (13 years ago)
Author:
itsalaska
Message:

Another bug fix

Location:
child-page-navigation
Files:
3 added
2 edited

Legend:

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

    r684872 r684879  
    66    Author: ITS Alaska
    77    Author URI: http://ITSCanFixThat.com/
    8     Version: 1.3.1
     8    Version: 1.3.2
    99
    1010    This program is free software: you can redistribute it and/or modify
     
    3131    }
    3232
    33     function form(){
    34         $opts = get_option('widget_theme_navigation');
    35        
    36         $key = array_keys(array_flip($opts));
    37         unset($key['_multiwidget']);
    38         var_dump($key);
    39       ?>
    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>
     33    function form($instance){
     34        $instance['tiutle'] = apply_filters( 'widget_title', $instance['title'] ); ?>
     35      <p>Title: <input name="cpn_title" id="cpn_title" type="text" <?php if(isset($instance['title']) && $instance['title'] != "") echo 'value="'.$instance['title'].'"'; ?> /></p>
     36      <p>Sort by Sort Order? <input name="cpn_sort" id="cpn_sort" type="checkbox" <?php if(isset($instance['sort']) && $instance['sort']) echo 'checked="checked"'; ?> value="1" /></p>
    4237    <?php }
    4338
     
    5752    }
    5853
    59     function widget($args){
     54    function widget($args,$instance){
    6055        global $post;
    61         $opts = get_option('widget_theme_navigation');
    62        
    63         $key = array_keys($opts);
    64         unset($key['_multiwidget']);
    65         $key = array_pop($key);
     56        $instance['title'] = apply_filters( 'widget_title', $instance['title'] );
    6657       
    6758        $page_arr = array('child_of' => $post->ID, 'parent' => $post->ID);
     
    8172        echo $args['before_widget'];
    8273       
    83         if(isset($opts[$key]['title']) && $opts[$key]['title'] != "")
    84             echo $args['before_title'].$opts[$key]['title'].$args['after_title'];
     74        if(isset($instance['title']) && $instance['title'] != "")
     75            echo $args['before_title'].$instance['title'].$args['after_title'];
    8576       
    8677        echo "<ul>";
  • child-page-navigation/trunk/readme.txt

    r684872 r684879  
    2121== Changelog ==
    2222
     23= 1.3.2 =
     24* Fixed bug to allow for having different settings on different instances of the widget
     25
    2326= 1.3.1 =
    2427* Fixed weird bug where some users couldn't update their widget
     
    2629= 1.3 =
    2730* Added option in widget to sort by page sort order
    28 * Recoded ~ File size went from 4,152 byts to 2,893 bytes
     31* Recoded ~ File size reduced by 30%
    2932
    3033= 1.2.1 =
Note: See TracChangeset for help on using the changeset viewer.