Version Description
Download this release
Release Info
Developer | alanft |
Plugin | Widget Logic |
Version | 0.45 |
Comparing to | |
See all releases |
Code changes from version 0.44 to 0.45
- readme.txt +2 -2
- widget_logic.php +4 -5
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: alanft
|
|
3 |
Tags: widget, admin, conditional tags, filter
|
4 |
Requires at least: 2.5
|
5 |
Tested up to: 2.7
|
6 |
-
Stable tag: 0.
|
7 |
|
8 |
Widget Logic lets you control when widgets appear. Add WP's conditional tags in the normal widget admin. It also adds a 'widget_content' filter.
|
9 |
|
@@ -63,7 +63,7 @@ Examples:
|
|
63 |
* `is_single() && in_category('baked-goods')`
|
64 |
* `is_page('about')`
|
65 |
* `current_user_can('level_10')`
|
66 |
-
* `global $post; return (
|
67 |
|
68 |
Note the use of ';' where there is an explicit 'return'. Use `||` (OR), `&&` (AND) and `!` (NOT) to make more complex conditions.
|
69 |
|
3 |
Tags: widget, admin, conditional tags, filter
|
4 |
Requires at least: 2.5
|
5 |
Tested up to: 2.7
|
6 |
+
Stable tag: 0.45
|
7 |
|
8 |
Widget Logic lets you control when widgets appear. Add WP's conditional tags in the normal widget admin. It also adds a 'widget_content' filter.
|
9 |
|
63 |
* `is_single() && in_category('baked-goods')`
|
64 |
* `is_page('about')`
|
65 |
* `current_user_can('level_10')`
|
66 |
+
* `global $post; return (is_page('home') || ($post->post_parent=="13"));`
|
67 |
|
68 |
Note the use of ';' where there is an explicit 'return'. Use `||` (OR), `&&` (AND) and `!` (NOT) to make more complex conditions.
|
69 |
|
widget_logic.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Widget Logic
|
|
4 |
Plugin URI: http://freakytrigger.co.uk/wordpress-setup/
|
5 |
Description: Control widgets with WP's conditional tags is_home etc
|
6 |
Author: Alan Trewartha
|
7 |
-
Version: 0.
|
8 |
Author URI: http://freakytrigger.co.uk/author/alan/
|
9 |
*/
|
10 |
|
@@ -15,8 +15,7 @@ add_action( 'sidebar_admin_setup', 'widget_logic_expand_control');
|
|
15 |
function widget_logic_expand_control()
|
16 |
{ global $wp_registered_widgets, $wp_registered_widget_controls;
|
17 |
|
18 |
-
if(!$wl_options = get_option('widget_logic')) $wl_options = array();
|
19 |
-
//print_r($wl_options);
|
20 |
|
21 |
// if we're just updating the widgets, just read in the widget logic settings - makes this WP2.5+ only i think
|
22 |
if ( 'post' == strtolower($_SERVER['REQUEST_METHOD']) )
|
@@ -63,7 +62,7 @@ add_action( 'sidebar_admin_page', 'widget_logic_options_filter');
|
|
63 |
|
64 |
function widget_logic_options_filter()
|
65 |
{
|
66 |
-
if(!$wl_options = get_option('widget_logic')) $wl_options = array();
|
67 |
?><div class="wrap">
|
68 |
<form method="POST">
|
69 |
<h2>Widget Logic options</h2>
|
@@ -87,7 +86,7 @@ function widget_logic_extra_control()
|
|
87 |
$id=(is_array($params[0]))?$params[0]['id_for_wl']:array_pop($params);
|
88 |
$id_disp=$id;
|
89 |
|
90 |
-
if(!$wl_options = get_option('widget_logic')) $wl_options = array();
|
91 |
|
92 |
$callback=$wp_registered_widget_controls[$id]['callback_wl_redirect'];
|
93 |
if (is_callable($callback))
|
4 |
Plugin URI: http://freakytrigger.co.uk/wordpress-setup/
|
5 |
Description: Control widgets with WP's conditional tags is_home etc
|
6 |
Author: Alan Trewartha
|
7 |
+
Version: 0.45
|
8 |
Author URI: http://freakytrigger.co.uk/author/alan/
|
9 |
*/
|
10 |
|
15 |
function widget_logic_expand_control()
|
16 |
{ global $wp_registered_widgets, $wp_registered_widget_controls;
|
17 |
|
18 |
+
if((!$wl_options = get_option('widget_logic')) || !is_array($wl_options) ) $wl_options = array();
|
|
|
19 |
|
20 |
// if we're just updating the widgets, just read in the widget logic settings - makes this WP2.5+ only i think
|
21 |
if ( 'post' == strtolower($_SERVER['REQUEST_METHOD']) )
|
62 |
|
63 |
function widget_logic_options_filter()
|
64 |
{
|
65 |
+
if((!$wl_options = get_option('widget_logic')) || !is_array($wl_options) ) $wl_options = array();
|
66 |
?><div class="wrap">
|
67 |
<form method="POST">
|
68 |
<h2>Widget Logic options</h2>
|
86 |
$id=(is_array($params[0]))?$params[0]['id_for_wl']:array_pop($params);
|
87 |
$id_disp=$id;
|
88 |
|
89 |
+
if((!$wl_options = get_option('widget_logic')) || !is_array($wl_options) ) $wl_options = array();
|
90 |
|
91 |
$callback=$wp_registered_widget_controls[$id]['callback_wl_redirect'];
|
92 |
if (is_callable($callback))
|