WordPress.org

Making WordPress.org

Changeset 6613


Ignore:
Timestamp:
02/12/18 23:01:06 (6 days ago)
Author:
coffee2code
Message:

Handbook plugin: Add checks for array index existence before use, to prevent PHP warnings after [6088].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php

    r6612 r6613  
    4545        parent::form( $instance ); 
    4646 
    47         $checked = $instance['show_home'] ? 'checked="checked"' : ''; 
     47        $checked = checked( ! empty( $instance['show_home'] ), true, false ); 
    4848        ?> 
    4949        <p> 
     
    5656    public function update( $new_instance, $old_instance ) { 
    5757        $instance = parent::update( $new_instance, $old_instance ); 
    58         $instance['show_home'] = (bool) $new_instance['show_home']; 
     58        $instance['show_home'] = isset( $new_instance['show_home'] ) ? (bool) $new_instance['show_home'] : false; 
    5959 
    6060        return $instance; 
Note: See TracChangeset for help on using the changeset viewer.