• Hi,

    I’ve been seeing an error that reads

    Unsupported operand types in /home/**********/plugins/wordpress-admin-bar/wordpress-admin-bar.php on line 466

    Well, of course I dug in to look at what was on line 466. It’s in the AddSingleEditLink() function, and apparently adds the ‘Edit This’ link as an item under the appropriate Posts or Pages menu (using an addition sign with arrays — something I’ve never seen before).

    The curiosity is that WordPress 3.0-alpha has renamed the top-level Pages menu link to edit.php?post_type=page from its original edit-pages.php. As a result, $menu['edit-pages.php'] doesn’t exist; it has become $menu['edit.php?post_type=page'].

    The attempt by AddSingleEditLink() to prepend the ‘Edit This’ link to the non-existent array fails spectacularly with a fatal error. By editing line 464’s reference to edit-pages.php to become edit.php?post_type=page, I was able to fix the problem.

    I hope this helps anybody else who discovered issues on WordPress 3.0-alpha, and maybe this can make its way into the next release of WordPress Admin Bar.

    Regards,
    Frederick

    http://ww.wp.xz.cn/extend/plugins/wordpress-admin-bar/

Viewing 1 replies (of 1 total)
  • I noticed the error on my localhost, but hadn’t had a chance to dig into it yet. Thanks for the heads up. 🙂

    As for the +, it’s a way to merge arrays: http://www.php.net/array_merge

    If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WordPress Admin Bar] Unsupported operands on WordPress 3.0-alpha’ is closed to new replies.