[wp-hackers] WP 2.2 Widgets Issue / Fix

Martin Fitzpatrick martin.fitzpatrick at gmail.com
Wed May 30 19:41:48 GMT 2007


On 28/05/07, Ryan Boren <ryan at boren.nu> wrote:
> On 5/28/07, Martin Fitzpatrick <martin.fitzpatrick at gmail.com> wrote:
> > I have been getting a lot of bug reports for one of my plugins under
> > Wp 2.2 using widgets. I know the call to install a widget changed to
> > remove some mucky code but since has been changed back to the original
> > way of doing it, with a release coming as 2.2.1(?)
>
> If you use the new wp_* prefixed functions mentioned in #4275, your plugin
> will work with 2.2.1.  The wp_ functions work properly.
>
> Don't change to accommodate the bug in the unprefixed functions.  That bug
> will be gone in 2.2.1.

Thanks for the explanation Ryan, much appreciated.

A few of my plugins switch to keeping the options panel/etc. in the
Widget if they are enabled, using a test "if (
function_exists('register_sidebar_widget') )" which won't work now -
the function always exists for compatibility.

An alternative is to keep options out of the Widgets at all times
(i.e. just put the options on an options page & keep the widget
control for "title" and nothing else) but I'd be interested to know if
there are alternatives.  It would also be useful to detect that
widgets are disabled/not supported and save running the code to load
them.

Any ideas?

Thanks,

Martin


More information about the wp-hackers mailing list