WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
widget logic not working after updating to WP 3.5 AND rolling back to 0.54 (2 posts)

  1. elida
    Member
    Posted 1 year ago #

    I read the other post (for 0.56 ) that said to roll back to 0.54, but I am still getting warning errors all over my site. Deactivated, reactived, cleared cache etc...
    How do i get rid of these all over the my site?

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /hermes/bosweb/web077/xxxxx/xxxxx/public_html/domain/www/new/wp-content/plugins/widget-logic/widget_logic.php(284) : eval()'d code on line 1

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /hermes/bosweb/web077/xxxxx/xxxxx/public_html/domain/www/new/wp-content/plugins/widget-logic/widget_logic.php(284) : eval()'d code on line 1

    thanks

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

  2. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    You should definitely be on 0.56 with WP 3.5, but there was a change in WP3.5 on a few functions.

    It is likely you have widgets using the WP function get_post_ancestors as the 2nd param of in_array. This produces the "Wrong datatype for second argument" error when get_post_ancestors returns false.

    You will have to adapt your code slightly eg from

    global $post; return (in_array(77,get_post_ancestors($post)));

    to

    global $post; return ($post) && (in_array(77,get_post_ancestors($post)));

    which returns false as soon as $post is false before trying the second half of the function.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic