Widget Logic - Version 5.8.1

Version Description

Fixed the issue of displaying errors under certain conditions.

Download this release

Release Info

Developer wpchefgadget
Plugin Icon 128x128 Widget Logic
Version 5.8.1
Comparing to
See all releases

Code changes from version 5.8.0 to 5.8.1

Files changed (2) hide show
  1. readme.txt +4 -1
  2. widget_logic.php +6 -13
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.justgiving.com/widgetlogic_cancerresearchuk
4
  Tags: widget, admin, conditional tags, filter, context
5
  Requires at least: 3.0
6
  Tested up to: 4.7.5
7
- Stable tag: 5.8.0
8
  License: GPLv2 or later
9
 
10
  Widget Logic lets you control on which pages widgets appear using WP's conditional tags. It also adds a 'widget_content' filter.
@@ -119,6 +119,9 @@ Tighten up your definitions with PHPs 'logical AND' &&, for example:
119
 
120
  == Changelog ==
121
 
 
 
 
122
  = 5.8.0 =
123
  Added full support for WP customizer.
124
 
4
  Tags: widget, admin, conditional tags, filter, context
5
  Requires at least: 3.0
6
  Tested up to: 4.7.5
7
+ Stable tag: 5.8.1
8
  License: GPLv2 or later
9
 
10
  Widget Logic lets you control on which pages widgets appear using WP's conditional tags. It also adds a 'widget_content' filter.
119
 
120
  == Changelog ==
121
 
122
+ = 5.8.1 =
123
+ Fixed the issue of displaying errors under certain conditions.
124
+
125
  = 5.8.0 =
126
  Added full support for WP customizer.
127
 
widget_logic.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Widget Logic
4
  Plugin URI: http://wordpress.org/extend/plugins/widget-logic/
5
  Description: Control widgets with WP's conditional tags is_home etc
6
- Version: 5.8.0
7
  Author: wpchefgadget, alanft
8
 
9
  Text Domain: widget-logic
@@ -359,25 +359,14 @@ function widget_logic_check_logic( $logic )
359
 
360
  global $wl_options, $wl_in_customizer;
361
 
362
- $show_errors = !empty($wl_options['widget_logic-options-show_errors']) && current_user_can('manage_options');
363
 
364
  set_error_handler( 'widget_logic_error_handler' );
365
 
366
- if ( $show_errors )
367
- $save = ini_get('display_errors');
368
  try {
369
- if ( $show_errors )
370
- ini_set( 'display_errors', 'On' );
371
-
372
  $show_widget = eval($logic);
373
-
374
- if ( $show_errors )
375
- ini_set( 'display_errors', $save );
376
  }
377
  catch ( Error $e ) {
378
  trigger_error( $e->getMessage(), E_USER_WARNING );
379
- if ( $show_errors )
380
- ini_set( 'display_errors', $save );
381
 
382
  $show_widget = false;
383
  }
@@ -389,7 +378,11 @@ function widget_logic_check_logic( $logic )
389
 
390
  function widget_logic_error_handler( $errno , $errstr )
391
  {
392
- echo 'Invalid Widget Logic: '.$errstr;
 
 
 
 
393
 
394
  return true;
395
  }
3
  Plugin Name: Widget Logic
4
  Plugin URI: http://wordpress.org/extend/plugins/widget-logic/
5
  Description: Control widgets with WP's conditional tags is_home etc
6
+ Version: 5.8.1
7
  Author: wpchefgadget, alanft
8
 
9
  Text Domain: widget-logic
359
 
360
  global $wl_options, $wl_in_customizer;
361
 
 
362
 
363
  set_error_handler( 'widget_logic_error_handler' );
364
 
 
 
365
  try {
 
 
 
366
  $show_widget = eval($logic);
 
 
 
367
  }
368
  catch ( Error $e ) {
369
  trigger_error( $e->getMessage(), E_USER_WARNING );
 
 
370
 
371
  $show_widget = false;
372
  }
378
 
379
  function widget_logic_error_handler( $errno , $errstr )
380
  {
381
+ global $wl_options;
382
+ $show_errors = !empty($wl_options['widget_logic-options-show_errors']) && current_user_can('manage_options');
383
+
384
+ if ( $show_errors )
385
+ echo 'Invalid Widget Logic: '.$errstr;
386
 
387
  return true;
388
  }