alanft
Forum Replies Created
-
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Problem with &&unless your home page is also a category page (which I’m not sure is even possible), that’s never going to be true.
if what you want is it to be true when it is_home OR it is_category, then use OR instead, ||
then the widget will appear when the showing page is your home or when it is a category
that’s live in the dev version now
http://wordpress.org/extend/plugins/widget-logic/developers/
filter: widget_logic_eval_override
any function hooked into this filter is passed the widget logic text. you can return the text altered in some way before it is EVAL’d, or you can bypass any EVAL’ing happening by returning with a boolean TRUE (show widget) or FALSE (don’t show)
looks ok IF you add a ‘;’ at the end of the apply_filters line
right now I can’t update the SVN to add those lines to the DEV version. i’ve just discovered that Mountain Lion doesn’t have SVN by default, and the main way to install it is to download the 1.5GB Xcode install :-/
hang on, I’ll try adding that now to see if it’s harmless, and then add it to the DEV codeβ¦
How about a filter instead of an action and I change the crucial code in WL plugin to
foreach($widget_list as $pos => $widget_id) { if (empty($wl_options[$widget_id])) continue; $wl_value=trim($wl_options[$widget_id]); if (empty($wl_value)) continue; $wl_value=apply_filters( "widget_logic_eval_override", $wl_value ) if ($wl_value===false) { unset($sidebars_widgets[$widget_area][$pos]); continue; } if ($wl_value===true) continue; if (stristr($wl_value,"return")===false) $wl_value="return (" . $wl_value . ");"; if (!eval($wl_value)) unset($sidebars_widgets[$widget_area][$pos]); }so the filter gives you the chance to step in and return a boolean value directly?
ah fair point π
I will try adding something to the DEV version soon for you to try – but apologies in advance as I have been promising to play with the code for weeks (to fix some bad coding and a couple of other small requests). However I’ll take a quick look at the code and write some basic amendment including a do_action for you to look at here. Just got to go light a barbecue now π
what I was getting at is you could put in your logic in the admin interface as the above without altering the WL plugin code, and that would have the same effect. Obviously you’d have to do it for each widget but it looks like you’d be putting something in the WL code anyway? (for your function to use as a param)
you can post one anywhere you like, or mail me at alan DOT trewartha AT gmail DOT com
I could put in an action that passes through the widget logic, and then does the eval if the result is true/false – I’ll think about which makes more sense.
can i ask why you wouldn’t simply put your function in the widget logic like this:
widget_logic_eval_override('some value for my function')which would have the effect of calling your function
If I understand you right, you might find the “What’s this stuff in my sidebar when there are no widgets?” section of the FAQ has your answer
I’m sorry to hear you are having problems, but I’m sorry I don’t understand the nature of the problem very well. Are you saying that the Publish button isn’t visible in the edit/add new post/page? maybe a screenshot would help, or if you like you could mail me ‘write post’ privilege only login details to your blog if you like
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] The combination of Conditional TagsThat’s going to go in the FAQ if it worked!
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Settings Disappearing?ok, but does the behaviour go if gantry is disabled – if so, then i have a strong clue about where to look and might have a solution
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Excluding a pagehttp://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page
eg !is_single( ’17’ ) or !is_single( ‘beef-stew’) would work
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Settings Disappearing?i’m trying to think of ways to help troubleshoot this.
When you save you say the field entirely vanishes – not just the content blanks but the whole text input field goes?
What happens if it’s just 2 plain text widgets – same behaviour? Same regardless of what sort of widget combinations you have, or just when using the one with the “Executable PHP widget” plugin?