Plugin Directory

Changeset 955604


Ignore:
Timestamp:
07/27/2014 04:37:31 PM (12 years ago)
Author:
alanft
Message:

Readme updates

Location:
widget-logic/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • widget-logic/trunk/readme.txt

    r955420 r955604  
    4141* Use 'wp_reset_query' fix -- Many features of WP, as well as the many themes and plugins out there, can mess with the conditional tags, such that is_home is NOT true on the home page. This can often be fixed with a quick wp_reset_query() statement just before the widgets are called, and this option puts that in for you rather than having to resort to code editing
    4242
     43*  Don't cache widget logic results -- From v .58 the widget logic code should only execute once, but that might cause unexpected results with some themes, so this option is here to turn that behaviour off.
     44
    4345* Load logic -- This option allows you to set the point in the page load at which your widget logic starts to be checked. Pre v.50 it was when the 'wp_head' trigger happened, ie during the creation of the HTML's HEAD block. Many themes didn't call wp_head, which was a problem. From v.50 it happens, by default, as early as possible, which is as soon as the plugin loads. You can now specify these 'late load' points (in chronological order):
    4446    * after the theme loads (after_setup_theme trigger)
    4547    * when all PHP loaded (wp_loaded trigger)
     48    * after query variables set (parse_query)
    4649    * during page header (wp_head trigger)
    4750
     
    5053== Frequently Asked Questions ==
    5154
    52 = Why isn't it working? =
    53 
    54 Try switching to the WP default theme - if the problem goes away, there is something specific to your theme that may be interfering with the WP conditional tags.
    55 
    56 The most common sources of problems are:
    57 
    58 * The logic text on one of your widgets is invalid PHP
    59 * Your theme performs custom queries before calling the dynamic sidebar -- if so, try ticking the `wp_reset_query` option.
    60 
    61 = Use 'wp_reset_query' fix option isn't working properly any more =
    62 
    63 In version 0.50 I made some fundamental changes to how Widget Logic works. The result was that the wp_reset_query was less targeted in the code. If lots of people find this problematic I will look at a general solution, but the main workround is to put wp_reset_query() into your code just before calling a dynamic sidebar.
     55= I upgraded to Version .58 and my site's widgets now behave differently =
     56
     57There were TWO important changes to how your Widget Logic code is evaluated. There is a new default 'Load logic' point of 'after query variables set'. For most people this should be better, but you could try reverting to the old default 'when plugin starts'.
     58
     59Also by default your widget logic now only executes once (at the 'Load logic' point, see above). Again, I expect this will suit most of the people most of the time, but maybe your site works better the old way. Tick the new 'Evaluate widget logic more than once' option.
     60
     61= What can I try if it's not working? =
     62
     63* Switch to the default theme. If the problem goes away, your theme may be interfering with the WP conditional tags or how widgets work
     64* Try the `wp_reset_query` option. If your theme performs custom queries before calling the dynamic sidebar this might help.
     65* Try a different 'Load logic' point. Most wordpress conditional tags only work 'when query variables set', but some plugins may require evaluation earlier or later.
     66* The 'Evaluate widget logic more than once' option may be needed if you have to use an early 'Load logic' point.
     67
     68
     69= I'm getting errors that read like "PHP Parse error… … eval()'d code on line 1" =
     70
     71You have a PHP syntax error in one of your widget's Widget Logic fields. Review them for errors. You might find it easiest to check by using 'Export options' and reading the code there (Though be aware that single and double quotes are escaped with multiple backslash characters.)
     72
     73If you are having trouble finding the syntax error, a simple troubleshooting method is to use 'Export options' to keep a copy and then blank each Widget Logic field in turn until the problem goes. Once you've identified the problematic code, you can restore the rest with 'Import options'.
     74
     75= It's causing problems with Woo Commerce / other popular plugin =
     76
     77This is often, not always, fixed by trying the different 'Load Logic' options. The 'after query variables set' option looks like it might be a better default, try it.
    6478
    6579= What's this stuff in my sidebar when there are no widgets? =
     
    7488
    7589= Logic using is_page() doesn't work =
     90
     91I believe this is fixed in 0.58. Let me know if that is not the case.
    7692
    7793If your theme calls the sidebar after the loop you should find that the wp_reset_query option fixes things. This problem is explained on the [is_page codex page](http://codex.wordpress.org/Function_Reference/is_page#Cannot_Be_Used_Inside_The_Loop).
     
    108124
    1091251. The 'Widget logic' field at work in standard widgets.
    110 2. The `widget_content` filter, `wp_reset_query` option and 'load logic point' options are at the foot of the widget admin page. You can also export and import your site's WL options for safe-keeping.
     1262. The `widget_content` filter, `wp_reset_query` option, 'don't cache results' option and 'load logic point' options are at the foot of the widget admin page. You can also export and import your site's WL options for safe-keeping.
    111127
    112128== Writing Logic Code ==
     
    185201== Changelog ==
    186202
     203= 0.58 =
     204A new default load logic point attached to the action 'parse_query'. By default the widget logic is only evaluated once.
     205
    187206Translation: Ukrainian by Roman Sulym
    188207
  • widget-logic/trunk/widget_logic.php

    r955427 r955604  
    1616
    1717global $wl_options;
    18 $wl_load_points=array(  'plugins_loaded'    =>  __( 'when plugin starts (default)', 'widget-logic' ),
     18$wl_load_points=array(  'plugins_loaded'    =>  __( 'when plugin starts', 'widget-logic' ),
    1919                        'after_setup_theme' =>  __( 'after theme loads', 'widget-logic' ),
    2020                        'wp_loaded'         =>  __( 'when all PHP loaded', 'widget-logic' ),
    21                         'parse_query'       =>  __( 'after query variables set', 'widget-logic'),
     21                        'parse_query'       =>  __( 'when query variables set (default)', 'widget-logic'),
    2222                        'wp_head'           =>  __( 'during page header', 'widget-logic' )
    2323                    );
Note: See TracChangeset for help on using the changeset viewer.