syntax error metabox.php
-
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
- The topic ‘syntax error metabox.php’ is closed to new replies.