Title: wierdness with $meta_boxes=array();
Last modified: August 21, 2016

---

# wierdness with $meta_boxes=array();

 *  [Cameron](https://wordpress.org/support/users/cameron-macintosh/)
 * (@cameron-macintosh)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wierdness-with-meta_boxesarray/)
 * I’m using v4.3.3 of the plugin on wp 3.6.
 * For some reason, I experienced some odd behaviors when I included this line from
   the demo.php script:
 * > `$meta_boxes = array();`
 * in a custom plugin where I was setting up my meta boxes. I had both my plugin
   and the demo.php script within the theme folder active at the same time.
 * When just my plugin was active, I saw a dozen errors coming from `RW_Meta_Box::
   normalize_fields`, my guess is that `RW_Meta_Box::normalize_fields` didn’t like
   the fact that I was passing an empty array to New(). Removing the seed empty 
   array fixed this.
 * When both my plugin and the demo script were active, the demo boxes would display
   whereas my plugin’s boxes would not. I think I was having interactions because
   I set up $meta_box in my plugin to be a global variable like the demo script 
   shows. When I switched over from a global to local variable, my plugin’s meta
   box reappeared. I get why one would use a global variable to pass around config
   like this, but it doesn’t seem like it’s 100% safe if one decides to configure
   multiple meta boxes scattered between the theme and plugins.
 * I’m not sure I would consider these bugs, per se, but it did give me several 
   hours of frustrated debugging until I figured it out.
 * [http://wordpress.org/plugins/meta-box/](http://wordpress.org/plugins/meta-box/)

The topic ‘wierdness with $meta_boxes=array();’ is closed to new replies.

 * ![](https://ps.w.org/meta-box/assets/icon-128x128.png?rev=1100915)
 * [Meta Box](https://wordpress.org/plugins/meta-box/)
 * [Support Threads](https://wordpress.org/support/plugin/meta-box/)
 * [Active Topics](https://wordpress.org/support/plugin/meta-box/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/meta-box/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/meta-box/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Cameron](https://wordpress.org/support/users/cameron-macintosh/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/wierdness-with-meta_boxesarray/)
 * Status: not resolved