Version Description
Fixed the settings form not being saved settings under some circumstances.
Added a setting to show logic code errors for admins (turned off by default).
Fixed the issue with quotes in error messages on some WP installations.
Download this release
Release Info
Developer | wpchefgadget |
Plugin | Widget Logic |
Version | 5.7.1 |
Comparing to | |
See all releases |
Code changes from version 5.7.0 to 5.7.1
- readme.txt +9 -2
- widget_logic.php +70 -47
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Widget Logic ===
|
2 |
-
Contributors:
|
3 |
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.2
|
7 |
-
Stable tag: 5.7.
|
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,13 @@ Tighten up your definitions with PHPs 'logical AND' &&, for example:
|
|
119 |
|
120 |
== Changelog ==
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
= 5.7.0 =
|
123 |
Fixed PHP 7 compatibility issue.
|
124 |
|
1 |
=== Widget Logic ===
|
2 |
+
Contributors: wpchefgadget, alanft
|
3 |
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.2
|
7 |
+
Stable tag: 5.7.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.7.1 =
|
123 |
+
Fixed the settings form not being saved settings under some circumstances.
|
124 |
+
|
125 |
+
Added a setting to show logic code errors for admins (turned off by default).
|
126 |
+
|
127 |
+
Fixed the issue with quotes in error messages on some WP installations.
|
128 |
+
|
129 |
= 5.7.0 =
|
130 |
Fixed PHP 7 compatibility issue.
|
131 |
|
widget_logic.php
CHANGED
@@ -3,8 +3,8 @@
|
|
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.7.
|
7 |
-
Author:
|
8 |
|
9 |
Text Domain: widget-logic
|
10 |
Domain Path: /languages/
|
@@ -16,12 +16,12 @@ register_activation_hook( __FILE__, 'widget_logic_activate' );
|
|
16 |
|
17 |
function widget_logic_activate()
|
18 |
{
|
19 |
-
$
|
20 |
-
if ( !empty( $
|
21 |
{
|
22 |
-
unset( $
|
23 |
-
add_option( '
|
24 |
-
update_option( '
|
25 |
}
|
26 |
add_option( 'widget_logic_version', WIDGET_LOGIC_VERSION, '', 'no' );
|
27 |
update_option( 'widget_logic_version', WIDGET_LOGIC_VERSION );
|
@@ -49,13 +49,13 @@ function widget_logic_init()
|
|
49 |
|
50 |
if ( !file_exists(WP_PLUGIN_DIR.'/limit-login-attempts-reloaded') && current_user_can('install_plugins') )
|
51 |
{
|
52 |
-
$
|
53 |
-
if ( empty( $
|
54 |
{
|
55 |
-
add_action( 'admin_notices', '
|
56 |
-
add_action( 'network_admin_notices', '
|
57 |
-
add_action( '
|
58 |
-
add_action( 'admin_enqueue_scripts', '
|
59 |
}
|
60 |
//enqueue admin/js/updates.js
|
61 |
}
|
@@ -86,7 +86,7 @@ else
|
|
86 |
add_action( $loadpoint, 'widget_logic_sidebars_widgets_filter_add' );
|
87 |
}
|
88 |
|
89 |
-
if (
|
90 |
add_filter( 'dynamic_sidebar_params', 'widget_logic_widget_display_callback', 10);
|
91 |
// redirect the widget callback so the output can be buffered and filtered
|
92 |
}
|
@@ -184,7 +184,7 @@ function widget_logic_expand_control()
|
|
184 |
|
185 |
// clean up empty options (in PHP5 use array_intersect_key)
|
186 |
$regd_plus_new=array_merge(array_keys($wp_registered_widgets),array_values($widgt_ids),
|
187 |
-
array('widget_logic-options-filter', 'widget_logic-options-wp_reset_query', 'widget_logic-options-load_point'));
|
188 |
foreach (array_keys($wl_options) as $key)
|
189 |
if (!in_array($key, $regd_plus_new))
|
190 |
unset($wl_options[$key]);
|
@@ -193,8 +193,10 @@ function widget_logic_expand_control()
|
|
193 |
// UPDATE OTHER WIDGET LOGIC OPTIONS
|
194 |
// must update this to use http://codex.wordpress.org/Settings_API
|
195 |
if ( isset($_POST['widget_logic-options-submit']) )
|
196 |
-
{
|
|
|
197 |
$wl_options['widget_logic-options-wp_reset_query'] = !empty($_POST['widget_logic-options-wp_reset_query']);
|
|
|
198 |
$wl_options['widget_logic-options-load_point']=$_POST['widget_logic-options-load_point'];
|
199 |
}
|
200 |
|
@@ -229,12 +231,12 @@ function widget_logic_options_control()
|
|
229 |
<form method="POST" style="float:left; width:45%">
|
230 |
<ul>
|
231 |
<li><label for="widget_logic-options-filter" title="<?php _e('Adds a new WP filter you can use in your own code. Not needed for main Widget Logic functionality.', 'widget-logic'); ?>">
|
232 |
-
<input id="widget_logic-options-filter" name="widget_logic-options-filter" type="checkbox" value="checked" class="checkbox" <?php if (
|
233 |
<?php _e('Add \'widget_content\' filter', 'widget-logic'); ?>
|
234 |
</label>
|
235 |
</li>
|
236 |
<li><label for="widget_logic-options-wp_reset_query" title="<?php _e('Resets a theme\'s custom queries before your Widget Logic is checked', 'widget-logic'); ?>">
|
237 |
-
<input id="widget_logic-options-wp_reset_query" name="widget_logic-options-wp_reset_query" type="checkbox" value="checked" class="checkbox" <?php if (
|
238 |
<?php _e('Use \'wp_reset_query\' fix', 'widget-logic'); ?>
|
239 |
</label>
|
240 |
</li>
|
@@ -257,6 +259,11 @@ function widget_logic_options_control()
|
|
257 |
</select>
|
258 |
</label>
|
259 |
</li>
|
|
|
|
|
|
|
|
|
|
|
260 |
</ul>
|
261 |
<?php submit_button( __( 'Save WL options', 'widget-logic' ), 'button-primary', 'widget_logic-options-submit', false ); ?>
|
262 |
|
@@ -300,9 +307,9 @@ function widget_logic_extra_control()
|
|
300 |
}
|
301 |
// output our extra widget logic field
|
302 |
echo "<p><label for='".$id_disp."-widget_logic'>". __('Widget logic:','widget-logic'). " <textarea class='widefat' type='text' name='".$id_disp."-widget_logic' id='".$id_disp."-widget_logic' >".$value."</textarea></label></p>";
|
303 |
-
if ( trim($value) && version_compare( PHP_VERSION, '7.0', '>=' ) )
|
304 |
{
|
305 |
-
$test = '$result = ('
|
306 |
try {
|
307 |
eval($test);
|
308 |
} catch ( Error $e )
|
@@ -336,11 +343,15 @@ function wl_charity($links, $file)
|
|
336 |
|
337 |
// CALLED ON 'sidebars_widgets' FILTER
|
338 |
function widget_logic_filter_sidebars_widgets($sidebars_widgets)
|
339 |
-
{
|
|
|
340 |
|
341 |
// reset any database queries done now that we're about to make decisions based on the context given in the WP query for the page
|
342 |
-
if ( !empty( $wl_options['widget_logic-options-wp_reset_query'] ) &&
|
343 |
-
{
|
|
|
|
|
|
|
344 |
|
345 |
// loop through every widget in every sidebar (barring 'wp_inactive_widgets') checking WL for each one
|
346 |
foreach($sidebars_widgets as $widget_area => $widget_list)
|
@@ -363,7 +374,7 @@ function widget_logic_filter_sidebars_widgets($sidebars_widgets)
|
|
363 |
|
364 |
$save = ini_get('display_errors');
|
365 |
try {
|
366 |
-
if ( current_user_can('manage_options') )
|
367 |
ini_set( 'display_errors', 'On' );
|
368 |
|
369 |
if (!eval($wl_value))
|
@@ -372,7 +383,7 @@ function widget_logic_filter_sidebars_widgets($sidebars_widgets)
|
|
372 |
ini_set( 'display_errors', $save );
|
373 |
}
|
374 |
catch ( Error $e ) {
|
375 |
-
if ( current_user_can('manage_options') )
|
376 |
trigger_error( 'Invalid Widget Logic: '.$e->getMessage(), E_USER_WARNING );
|
377 |
|
378 |
ini_set( 'display_errors', $save );
|
@@ -422,46 +433,58 @@ function widget_logic_redirected_callback()
|
|
422 |
}
|
423 |
|
424 |
|
425 |
-
function
|
426 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
$screen = get_current_screen();
|
428 |
|
429 |
?>
|
430 |
-
<div class="notice notice-
|
431 |
<p class="plugin-card-limit-login-attempts-reloaded"<?php if ( $screen->id != 'plugin-install' ) echo ' id="plugin-filter"' ?>>
|
432 |
-
<b>Widget Logic team security recommendation
|
433 |
-
<a href="<?php echo network_admin_url('plugin-install.php?tab=plugin-information')?>&plugin=limit-login-attempts-reloaded&TB_iframe=true&width=600&height=550" class="thickbox open-plugin-details-modal button" aria-label="More information about Limit Login Attempts Reloaded" data-title="Limit Login Attempts Reloaded" id="
|
434 |
<a class="install-now button" data-slug="limit-login-attempts-reloaded" href="<?php echo network_admin_url('update.php?action=install-plugin')?>&plugin=limit-login-attempts-reloaded&_wpnonce=<?php echo wp_create_nonce('install-plugin_limit-login-attempts-reloaded') ?>" aria-label="Install Limit Login Attempts Reloaded now" data-name="Limit Login Attempts Reloaded" style="display:none">Install Now</a>
|
435 |
</p>
|
436 |
</div>
|
437 |
<script>
|
438 |
-
jQuery('#
|
439 |
-
jQuery('#
|
440 |
return true;
|
441 |
});
|
442 |
jQuery(function($){
|
443 |
-
var
|
444 |
-
|
445 |
//e.preventDefault
|
446 |
$.post( ajaxurl, {
|
447 |
-
action: '
|
448 |
-
|
449 |
-
sec: <?php echo json_encode( wp_create_nonce('
|
450 |
} );
|
451 |
});
|
452 |
|
453 |
<?php if ( $screen->id == 'plugin-install' ): ?>
|
454 |
-
$('#plugin-filter').prepend(
|
455 |
<?php endif ?>
|
456 |
|
457 |
$(document).on('tb_unload', function(){
|
458 |
-
if ( jQuery('#
|
459 |
return;
|
460 |
|
461 |
-
jQuery('#
|
462 |
});
|
463 |
$(document).on('credential-modal-cancel', function(){
|
464 |
-
jQuery('#
|
465 |
});
|
466 |
});
|
467 |
</script>
|
@@ -469,20 +492,20 @@ function widget_logic_promo()
|
|
469 |
wp_print_request_filesystem_credentials_modal();
|
470 |
}
|
471 |
|
472 |
-
function
|
473 |
{
|
474 |
-
check_ajax_referer( '
|
475 |
|
476 |
-
$
|
477 |
-
$
|
478 |
|
479 |
-
add_option( '
|
480 |
-
update_option( '
|
481 |
|
482 |
exit;
|
483 |
}
|
484 |
|
485 |
-
function
|
486 |
{
|
487 |
wp_enqueue_script( 'plugin-install' );
|
488 |
add_thickbox();
|
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.7.1
|
7 |
+
Author: wpchefgadget, alanft
|
8 |
|
9 |
Text Domain: widget-logic
|
10 |
Domain Path: /languages/
|
16 |
|
17 |
function widget_logic_activate()
|
18 |
{
|
19 |
+
$alert = (array)get_option( 'wpchefgadget_alert', array() );
|
20 |
+
if ( get_option('widget_logic_version') != WIDGET_LOGIC_VERSION && !empty( $alert['limit-login-attempts'] ) )
|
21 |
{
|
22 |
+
unset( $alert['limit-login-attempts'] );
|
23 |
+
add_option( 'wpchefgadget_alert', $alert, '', 'no' );
|
24 |
+
update_option( 'wpchefgadget_alert', $alert );
|
25 |
}
|
26 |
add_option( 'widget_logic_version', WIDGET_LOGIC_VERSION, '', 'no' );
|
27 |
update_option( 'widget_logic_version', WIDGET_LOGIC_VERSION );
|
49 |
|
50 |
if ( !file_exists(WP_PLUGIN_DIR.'/limit-login-attempts-reloaded') && current_user_can('install_plugins') )
|
51 |
{
|
52 |
+
$alert = (array)get_option( 'wpchefgadget_alert', array() );
|
53 |
+
if ( empty( $alert['limit-login-attempts'] ) )
|
54 |
{
|
55 |
+
add_action( 'admin_notices', 'widget_logic_alert');
|
56 |
+
add_action( 'network_admin_notices', 'widget_logic_alert');
|
57 |
+
add_action( 'wp_ajax_wpchefgadget_dismiss_alert', 'widget_logic_dismiss_alert' );
|
58 |
+
add_action( 'admin_enqueue_scripts', 'widget_logic_alert_scripts' );
|
59 |
}
|
60 |
//enqueue admin/js/updates.js
|
61 |
}
|
86 |
add_action( $loadpoint, 'widget_logic_sidebars_widgets_filter_add' );
|
87 |
}
|
88 |
|
89 |
+
if ( !empty($wl_options['widget_logic-options-filter']) )
|
90 |
add_filter( 'dynamic_sidebar_params', 'widget_logic_widget_display_callback', 10);
|
91 |
// redirect the widget callback so the output can be buffered and filtered
|
92 |
}
|
184 |
|
185 |
// clean up empty options (in PHP5 use array_intersect_key)
|
186 |
$regd_plus_new=array_merge(array_keys($wp_registered_widgets),array_values($widgt_ids),
|
187 |
+
array('widget_logic-options-filter', 'widget_logic-options-wp_reset_query', 'widget_logic-options-load_point', 'widget_logic-options-show_errors'));
|
188 |
foreach (array_keys($wl_options) as $key)
|
189 |
if (!in_array($key, $regd_plus_new))
|
190 |
unset($wl_options[$key]);
|
193 |
// UPDATE OTHER WIDGET LOGIC OPTIONS
|
194 |
// must update this to use http://codex.wordpress.org/Settings_API
|
195 |
if ( isset($_POST['widget_logic-options-submit']) )
|
196 |
+
{
|
197 |
+
$wl_options['widget_logic-options-filter'] = !empty($_POST['widget_logic-options-filter']);
|
198 |
$wl_options['widget_logic-options-wp_reset_query'] = !empty($_POST['widget_logic-options-wp_reset_query']);
|
199 |
+
$wl_options['widget_logic-options-show_errors'] = !empty($_POST['widget_logic-options-show_errors']);
|
200 |
$wl_options['widget_logic-options-load_point']=$_POST['widget_logic-options-load_point'];
|
201 |
}
|
202 |
|
231 |
<form method="POST" style="float:left; width:45%">
|
232 |
<ul>
|
233 |
<li><label for="widget_logic-options-filter" title="<?php _e('Adds a new WP filter you can use in your own code. Not needed for main Widget Logic functionality.', 'widget-logic'); ?>">
|
234 |
+
<input id="widget_logic-options-filter" name="widget_logic-options-filter" type="checkbox" value="checked" class="checkbox" <?php if (!empty($wl_options['widget_logic-options-filter'])) echo "checked" ?>/>
|
235 |
<?php _e('Add \'widget_content\' filter', 'widget-logic'); ?>
|
236 |
</label>
|
237 |
</li>
|
238 |
<li><label for="widget_logic-options-wp_reset_query" title="<?php _e('Resets a theme\'s custom queries before your Widget Logic is checked', 'widget-logic'); ?>">
|
239 |
+
<input id="widget_logic-options-wp_reset_query" name="widget_logic-options-wp_reset_query" type="checkbox" value="checked" class="checkbox" <?php if (!empty($wl_options['widget_logic-options-wp_reset_query'])) echo "checked" ?> />
|
240 |
<?php _e('Use \'wp_reset_query\' fix', 'widget-logic'); ?>
|
241 |
</label>
|
242 |
</li>
|
259 |
</select>
|
260 |
</label>
|
261 |
</li>
|
262 |
+
<li>
|
263 |
+
<label for="widget_logic-options-show_errors">
|
264 |
+
<input id="widget_logic-show_errors" name="widget_logic-options-show_errors" type="checkbox" value="1" class="checkbox" <?php if (!empty($wl_options['widget_logic-options-show_errors'])) echo "checked" ?> />
|
265 |
+
<?php esc_html_e('Display logic errors to admin', 'widget-logic'); ?>
|
266 |
+
</label>
|
267 |
</ul>
|
268 |
<?php submit_button( __( 'Save WL options', 'widget-logic' ), 'button-primary', 'widget_logic-options-submit', false ); ?>
|
269 |
|
307 |
}
|
308 |
// output our extra widget logic field
|
309 |
echo "<p><label for='".$id_disp."-widget_logic'>". __('Widget logic:','widget-logic'). " <textarea class='widefat' type='text' name='".$id_disp."-widget_logic' id='".$id_disp."-widget_logic' >".$value."</textarea></label></p>";
|
310 |
+
if ( !empty($wl_options['widget_logic-options-show_errors']) && trim($value) && version_compare( PHP_VERSION, '7.0', '>=' ) )
|
311 |
{
|
312 |
+
$test = '$result = ('.trim(stripslashes($wl_options[$id ])).'); return true;';
|
313 |
try {
|
314 |
eval($test);
|
315 |
} catch ( Error $e )
|
343 |
|
344 |
// CALLED ON 'sidebars_widgets' FILTER
|
345 |
function widget_logic_filter_sidebars_widgets($sidebars_widgets)
|
346 |
+
{
|
347 |
+
global $wp_reset_query_is_done, $wl_options;
|
348 |
|
349 |
// reset any database queries done now that we're about to make decisions based on the context given in the WP query for the page
|
350 |
+
if ( !empty( $wl_options['widget_logic-options-wp_reset_query'] ) && empty( $wp_reset_query_is_done ) )
|
351 |
+
{
|
352 |
+
wp_reset_query();
|
353 |
+
$wp_reset_query_is_done=true;
|
354 |
+
}
|
355 |
|
356 |
// loop through every widget in every sidebar (barring 'wp_inactive_widgets') checking WL for each one
|
357 |
foreach($sidebars_widgets as $widget_area => $widget_list)
|
374 |
|
375 |
$save = ini_get('display_errors');
|
376 |
try {
|
377 |
+
if ( !empty($wl_options['widget_logic-options-show_errors']) && current_user_can('manage_options') )
|
378 |
ini_set( 'display_errors', 'On' );
|
379 |
|
380 |
if (!eval($wl_value))
|
383 |
ini_set( 'display_errors', $save );
|
384 |
}
|
385 |
catch ( Error $e ) {
|
386 |
+
if ( current_user_can('manage_options') && !empty($wl_options['widget_logic-options-show_errors']) )
|
387 |
trigger_error( 'Invalid Widget Logic: '.$e->getMessage(), E_USER_WARNING );
|
388 |
|
389 |
ini_set( 'display_errors', $save );
|
433 |
}
|
434 |
|
435 |
|
436 |
+
function widget_logic_alert()
|
437 |
{
|
438 |
+
if ( $old = get_option('wpchefgadget_promo') )
|
439 |
+
{
|
440 |
+
delete_option('wpchefgadget_promo');
|
441 |
+
if ( $old['limit-login-attempts'] )
|
442 |
+
{
|
443 |
+
$alert = (array)get_option( 'wpchefgadget_alert', array() );
|
444 |
+
$alert['limit-login-attempts'] = $old['limit-login-attempts'];
|
445 |
+
update_option( 'wpchefgadget_alert', $alert );
|
446 |
+
return;
|
447 |
+
}
|
448 |
+
}
|
449 |
+
|
450 |
$screen = get_current_screen();
|
451 |
|
452 |
?>
|
453 |
+
<div class="notice notice-info is-dismissible" id="wpchefgadget_alert_lla">
|
454 |
<p class="plugin-card-limit-login-attempts-reloaded"<?php if ( $screen->id != 'plugin-install' ) echo ' id="plugin-filter"' ?>>
|
455 |
+
<b>Widget Logic team security recommendation only!</b> If your site is currently not protected (check with your admin) against login attacks (the most common reason admin login gets compromised) we highly recommend installing <a href="<?php echo network_admin_url('plugin-install.php?tab=plugin-information')?>&plugin=limit-login-attempts-reloaded&TB_iframe=true&width=600&height=550" class="thickbox open-plugin-details-modal" aria-label="More information about Limit Login Attempts Reloaded" data-title="Limit Login Attempts Reloaded">Limit Login Attempts Reloaded</a> plugin to immediately have the protection in place.
|
456 |
+
<a href="<?php echo network_admin_url('plugin-install.php?tab=plugin-information')?>&plugin=limit-login-attempts-reloaded&TB_iframe=true&width=600&height=550" class="thickbox open-plugin-details-modal button" aria-label="More information about Limit Login Attempts Reloaded" data-title="Limit Login Attempts Reloaded" id="wpchef_alert_install_button">Install</a>
|
457 |
<a class="install-now button" data-slug="limit-login-attempts-reloaded" href="<?php echo network_admin_url('update.php?action=install-plugin')?>&plugin=limit-login-attempts-reloaded&_wpnonce=<?php echo wp_create_nonce('install-plugin_limit-login-attempts-reloaded') ?>" aria-label="Install Limit Login Attempts Reloaded now" data-name="Limit Login Attempts Reloaded" style="display:none">Install Now</a>
|
458 |
</p>
|
459 |
</div>
|
460 |
<script>
|
461 |
+
jQuery('#wpchefgadget_alert_lla .open-plugin-details-modal').on('click', function(){
|
462 |
+
jQuery('#wpchef_alert_install_button').hide().next().show();
|
463 |
return true;
|
464 |
});
|
465 |
jQuery(function($){
|
466 |
+
var alert = $('#wpchefgadget_alert_lla');
|
467 |
+
alert.on('click', '.notice-dismiss', function(e){
|
468 |
//e.preventDefault
|
469 |
$.post( ajaxurl, {
|
470 |
+
action: 'wpchefgadget_dismiss_alert',
|
471 |
+
alert: 'limit-login-attempts',
|
472 |
+
sec: <?php echo json_encode( wp_create_nonce('wpchefgadget_dissmiss_alert') ) ?>
|
473 |
} );
|
474 |
});
|
475 |
|
476 |
<?php if ( $screen->id == 'plugin-install' ): ?>
|
477 |
+
$('#plugin-filter').prepend( alert.css('margin-bottom','10px').addClass('inline') );
|
478 |
<?php endif ?>
|
479 |
|
480 |
$(document).on('tb_unload', function(){
|
481 |
+
if ( jQuery('#wpchef_alert_install_button').next().hasClass('updating-message') )
|
482 |
return;
|
483 |
|
484 |
+
jQuery('#wpchef_alert_install_button').show().next().hide();
|
485 |
});
|
486 |
$(document).on('credential-modal-cancel', function(){
|
487 |
+
jQuery('#wpchef_alert_install_button').show().next().hide();
|
488 |
});
|
489 |
});
|
490 |
</script>
|
492 |
wp_print_request_filesystem_credentials_modal();
|
493 |
}
|
494 |
|
495 |
+
function widget_logic_dismiss_alert()
|
496 |
{
|
497 |
+
check_ajax_referer( 'wpchefgadget_dissmiss_alert', 'sec' );
|
498 |
|
499 |
+
$alert = (array)get_option( 'wpchefgadget_alert', array() );
|
500 |
+
$alert[ $_POST['alert'] ] = 1;
|
501 |
|
502 |
+
add_option( 'wpchefgadget_alert', $alert, '', 'no' );
|
503 |
+
update_option( 'wpchefgadget_alert', $alert );
|
504 |
|
505 |
exit;
|
506 |
}
|
507 |
|
508 |
+
function widget_logic_alert_scripts()
|
509 |
{
|
510 |
wp_enqueue_script( 'plugin-install' );
|
511 |
add_thickbox();
|