Plugin Directory

Changeset 1216958


Ignore:
Timestamp:
08/10/2015 09:02:26 AM (11 years ago)
Author:
Shellbot
Message:

Compatibility with WP4.3

Location:
easy-image-display/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • easy-image-display/trunk/readme.txt

    r1202298 r1216958  
    33Tags: image, gallery, latest image, random image
    44Requires at least: 3.5
    5 Tested up to: 4.2.2
     5Tested up to: 4.3
    66Donate link: http://patreon.com/shellbot
    77Stable tag: trunk
     
    127127== Changelog ==
    128128
     129= 1.2.4 =
     130* Compatibility with WP 4.3
     131
    129132= 1.2.3 =
    130133* Fixed problem with caption links + lightbox
     
    161164== Upgrade Notice ==
    162165
     166= 1.2.4 =
     167* Fixes compatibility with upcoming WP 4.3
     168
    163169= 1.2.3 =
    164170* Fixes problem with caption links + lightbox
  • easy-image-display/trunk/sb-easy-image-display.php

    r1202298 r1216958  
    44Plugin URI: http://codebyshellbot.com/wordpress-plugins/easy-image-display/
    55Description: An easy way to display random or latest images on your site.
    6 Version: 1.2.3
     6Version: 1.2.4
    77Author: Shellbot
    88Author URI: http://codebyshellbot.com
  • easy-image-display/trunk/sb-easy-image-widget.php

    r1193132 r1216958  
    22/**
    33 * Widget Name: Easy Image Display
    4  * Version: 1.2.3
     4 * Version: 1.2.4
    55 */
    66
     
    1515
    1616class SB_Easy_Image_Widget extends WP_Widget {
    17  
     17
    1818    /* Widget setup --------------------------------------------------------- */
    19    
    20     function SB_Easy_Image_Widget() {
    21 
    22         $widget_ops = array( 
    23             'classname' => 'widget-sb-easy-image', 
     19
     20    function __construct() {
     21
     22        $widget_ops = array(
     23            'classname' => 'widget-sb-easy-image',
    2424            'description' => esc_html__('Arrange and display your uploaded images', 'shellbotics'),
    2525        );
    26        
    27         $control_ops = array( 
    28             'width' => 150, 
    29             'height' => 350, 
     26
     27        $control_ops = array(
     28            'width' => 150,
     29            'height' => 350,
    3030            'id_base' => 'sb-easy-image-widget',
    3131        );
    3232
    33         $this->WP_Widget( 'sb-easy-image-widget', esc_html__( 'SB Easy Image', 'shellbotics' ), $widget_ops, $control_ops );
    34     }
    35 
    36    
     33        parent::__construct( 'sb-easy-image-widget', esc_html__( 'SB Easy Image', 'shellbotics' ), $widget_ops, $control_ops );
     34    }
     35
     36
    3737    /* Update --------------------------------------------------------------- */
    38    
     38
    3939    function update( $new_instance, $old_instance ) {
    4040        $instance = $old_instance;
     
    5252        return $instance;
    5353    }
    54    
     54
    5555    /* Return possible settings as array ---------------------------------------- */
    5656
    57     function sb_easy_image_params() { 
     57    function sb_easy_image_params() {
    5858
    5959        $params = array(
     
    6161                'Show all',
    6262                'Include only',
    63                 'Exclude', 
    64             ), 
     63                'Exclude',
     64            ),
    6565            'yesno' => array(
    6666                'Yes',
    67                 'No', 
    68             ), 
     67                'No',
     68            ),
    6969            'order' => array(
    7070                'Newest',
     
    7272                'Random',
    7373                'Custom',
    74             ), 
     74            ),
    7575            'sizes' => array(
    7676                'Thumbnail',
     
    7878                'Large',
    7979                'Full',
    80             ), 
     80            ),
    8181            'link' => array(
    8282                'None',
     
    103103
    104104    /* Settings ------------------------------------------------------------- */
    105    
     105
    106106    function form( $instance ) {
    107        
     107
    108108        $params = $this->sb_easy_image_params();
    109109
    110             $defaults = array( 
    111                 'title' => esc_html__( 'Latest Image', 'shellbotics' ), 
     110            $defaults = array(
     111                'title' => esc_html__( 'Latest Image', 'shellbotics' ),
    112112                'order' => 'newest',
    113113                'size' => 'thumbnail',
    114                 'num' => 1, 
     114                'num' => 1,
    115115                'link' => 'File',
    116116                'url' => '',
     
    121121            );
    122122
    123             $instance = wp_parse_args( (array) $instance, $defaults ); 
    124            
     123            $instance = wp_parse_args( (array) $instance, $defaults );
     124
    125125            ?>
    126126
     
    129129                <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'shellbotics' ); ?></label>
    130130                <input id="<?php echo $this->get_field_id( 'title' ); ?>" type="text" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" class="widefat" />
    131             </p> 
     131            </p>
    132132
    133133            <!-- Number of images to display -->
     
    135135                <label for="<?php echo $this->get_field_id( 'num' ); ?>"><?php esc_html_e( 'Number of images to display', 'shellbotics' ); ?></label>
    136136                <input id="<?php echo $this->get_field_id( 'num' ); ?>" type="text" name="<?php echo $this->get_field_name( 'num' ); ?>" value="<?php echo $instance['num']; ?>" class="widefat" />
    137             </p> 
     137            </p>
    138138
    139139            <!-- Display order -->
     
    148148                        </option>
    149149                    <?php
    150                     } 
     150                    }
    151151                    ?>
    152152                </select>
    153153            </p>
    154            
     154
    155155            <!-- Captions -->
    156156            <p>
     
    164164                        </option>
    165165                    <?php
    166                     } 
     166                    }
    167167                    ?>
    168168                </select>
     
    184184                            </option>
    185185                        <?php
    186                         } 
     186                        }
    187187                        ?>
    188188                    </select>
     
    200200                            </option>
    201201                        <?php
    202                         } 
     202                        }
    203203                        ?>
    204204                    </select>
    205205                </p>
    206                
     206
    207207            <!-- Static URL -->
    208208            <p>
    209209                <label for="<?php echo $this->get_field_id( 'url' ); ?>"><?php esc_html_e( 'Static URL', 'shellbotics' ); ?></label>
    210210                <input id="<?php echo $this->get_field_id( 'url' ); ?>" type="text" name="<?php echo $this->get_field_name( 'url' ); ?>" value="<?php echo $instance['url']; ?>" class="widefat" />
    211             </p> 
    212                
     211            </p>
     212
    213213            <!-- Number of columns to display -->
    214214            <p>
    215215                <label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php esc_html_e( 'Number of columns to display', 'shellbotics' ); ?></label>
    216216                <input id="<?php echo $this->get_field_id( 'columns' ); ?>" type="text" name="<?php echo $this->get_field_name( 'columns' ); ?>" value="<?php echo $instance['columns']; ?>" class="widefat" />
    217             </p> 
    218            
     217            </p>
     218
    219219            <!-- Filter -->
    220220            <p>
     
    228228                        </option>
    229229                    <?php
    230                     } 
     230                    }
    231231                    ?>
    232232                </select>
    233233            </p>
    234  
     234
    235235            <!-- Image IDs -->
    236236            <p>
    237237                <label for="<?php echo $this->get_field_id( 'ids' ); ?>"><?php esc_html_e( 'Image IDs (separate with comma)', 'shellbotics' ); ?></label>
    238238                <input id="<?php echo $this->get_field_id( 'ids' ); ?>" type="text" name="<?php echo $this->get_field_name( 'ids' ); ?>" value="<?php echo $instance['ids']; ?>" class="widefat" />
    239             </p> 
     239            </p>
    240240
    241241            </div>
     
    244244    }
    245245
    246    
     246
    247247    /* Display -------------------------------------------------------------- */
    248    
     248
    249249    function widget( $args, $instance ) {
    250250
     
    257257            'order'   => $instance['order'],
    258258            'size'    => $instance['size'],
    259             'link'    => $instance['link'], 
     259            'link'    => $instance['link'],
    260260            'url'     => $instance['url'],
    261261            'columns' => $instance['columns'],
     
    270270            echo $before_title . $settings['title'] . $after_title;
    271271        }
    272        
     272
    273273        global $sbcid;
    274274        echo $sbcid->sb_image_widget( $settings );
     
    276276        echo $after_widget;
    277277    }
    278    
     278
    279279} // SB_Image_Widget class ends
Note: See TracChangeset for help on using the changeset viewer.