Title: syntax error metabox.php
Last modified: August 22, 2016

---

# syntax error metabox.php

 *  [HarroH](https://wordpress.org/support/users/harroh/)
 * (@harroh)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/syntax-error-metaboxphp/)
 * Hi Guys,
 * First of all, nice plugin. However, when installing the plugin on a Nginx server
   with HHVM on it, it created a famous wordpress error:
 * `Fatal error: syntax error, unexpected $end in /home/public_html/wp-content/plugins/
   advanced-access-manager/application/control/object/metabox.php on line 1`
 * It seems there is some invalid character somewhere in the code, maybe a weird
   space, tab or just an invisible character. But after compiling the php file to
   its minimum, it worked:
 * `<?php
    class aam_Control_Object_Metabox extends aam_Control_Object {const UID
   = 'metabox';private $_option = array();public function filterFrontend($sidebar_widgets){
   global $wp_registered_widgets;if (is_array($wp_registered_widgets)) {foreach (
   $wp_registered_widgets as $id => $data) {if (is_object($data['callback'][0])){
   $callback = get_class($data['callback'][0]);} elseif (is_string($data['callback'][
   0])) {$callback = $data['callback'][0];}if ($this->has('widgets', $callback)){
   unregister_widget($callback);unset($wp_registered_widgets[$id]);}}}return $sidebar_widgets;}
   public function filterBackend($screen, $post = null) {global $wp_meta_boxes;if(
   is_array($wp_meta_boxes)) {foreach ($wp_meta_boxes as $screen_id => $zones) {
   if ($screen == $screen_id) {foreach ($zones as $zone => $priorities) {foreach(
   $priorities as $priority => $metaboxes) {foreach ($metaboxes as $metabox => $
   data) {if ($this->has($screen_id, $metabox)) {remove_meta_box($metabox, $screen_id,
   $zone);}}}}}}}}public function save($metaboxes = null) {if (is_array($metaboxes)){
   $this->getSubject()->updateOption($metaboxes, self::UID);$this->getSubject()-
   >setFlag(aam_Control_Subject::FLAG_MODIFIED);}}public function cacheObject(){
   return true;}public function getUID() {return self::UID;}public function setOption(
   $option) {$this->_option = (is_array($option) ? $option : array());}public function
   getOption() {return $this->_option;}public function has($group, $metabox) {$response
   = false;if (isset($this->_option[$group][$metabox])) {$response = (intval($this-
   >_option[$group][$metabox]) ? true : false);}return $response;}}?>
 * Might wanna look into this for the next update.
 * Cheers, H
 * [https://wordpress.org/plugins/advanced-access-manager/](https://wordpress.org/plugins/advanced-access-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [SilvioCro](https://wordpress.org/support/users/silviocro/)
 * (@silviocro)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/syntax-error-metaboxphp/#post-5904395)
 * Thanks a lot! It’s working
 *  [tjoepke](https://wordpress.org/support/users/tjoepke/)
 * (@tjoepke)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/syntax-error-metaboxphp/#post-5904549)
 * Thanks HarroH, these works for me.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘syntax error metabox.php’ is closed to new replies.

 * ![](https://ps.w.org/advanced-access-manager/assets/icon-256x256.png?rev=3447421)
 * [Advanced Access Manager – Access Governance for WordPress](https://wordpress.org/plugins/advanced-access-manager/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-access-manager/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [tjoepke](https://wordpress.org/support/users/tjoepke/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/syntax-error-metaboxphp/#post-5904549)
 * Status: not a support question