WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Error First argument should be an array (2 posts)

  1. lorddonk
    Member
    Posted 2 years ago #

    Warning: array_push() [function.array-push]: First argument should be an array in [...]/wp-content/plugins/widget-logic/widget_logic.php on line 67

    I think this is because I have two "widget" modifying plugins. Your widget logic program (which is amazing!) and another plugin which lets me add a class to all my widgets

    http://wordpress.org/extend/plugins/widget-classes/

    Can this problem be fixed?

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    W Logic and W classes use different, but related, ways of intercepting the control on the widget's config page which I think are mutually incompatible.

    WL adds the ID to the widget's params, WC replaces the params with just the ID, saving the params elsewhere. You could try expanding line 67 of WL to something like

    if (is_array($wp_registered_widget_controls[$id]['params']))
    	array_push($wp_registered_widget_controls[$id]['params'],$id);
    else if (isset($wp_registered_widget_controls[$id]['_params']))
    	array_push($wp_registered_widget_controls[$id]['_params'],$id);

    but i've not tried it as i'm way too lazy at the moment, sorry.

    All respect to the writer and users of WC, I don't see what WC is for as widgets already have CSS classes, and blocking different classes together in the CSS code seems like less coding overhead.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic