@@ -28,7 +28,9 @@ discard block |
||
| 28 | 28 | public function init() |
| 29 | 29 | { |
| 30 | 30 | // @todo: run GateKeeper here instead to check dependencies and capability |
| 31 | - if( !is_plugin_active( 'meta-box/meta-box.php' ))return; |
|
| 31 | + if( !is_plugin_active( 'meta-box/meta-box.php' )) { |
|
| 32 | + return; |
|
| 33 | + } |
|
| 32 | 34 | |
| 33 | 35 | $this->normalize(); |
| 34 | 36 | |
@@ -105,7 +107,9 @@ discard block |
||
| 105 | 107 | */ |
| 106 | 108 | public function register( $metaboxes = [] ) |
| 107 | 109 | { |
| 108 | - if( get_current_screen()->id != $this->hook )return; |
|
| 110 | + if( get_current_screen()->id != $this->hook ) { |
|
| 111 | + return; |
|
| 112 | + } |
|
| 109 | 113 | foreach( parent::register() as $metabox ) { |
| 110 | 114 | new SettingsMetaBox( $metabox ); |
| 111 | 115 | } |
@@ -178,7 +182,9 @@ discard block |
||
| 178 | 182 | { |
| 179 | 183 | if( filter_input( INPUT_GET, 'page' ) !== self::ID |
| 180 | 184 | || filter_input( INPUT_GET, 'action' ) !== 'reset' |
| 181 | - )return; |
|
| 185 | + ) { |
|
| 186 | + return; |
|
| 187 | + } |
|
| 182 | 188 | if( wp_verify_nonce( filter_input( INPUT_GET, '_wpnonce' ), $this->hook )) { |
| 183 | 189 | delete_option( self::ID ); |
| 184 | 190 | // @todo: now trigger save to restore defaults |
@@ -192,7 +198,8 @@ discard block |
||
| 192 | 198 | */ |
| 193 | 199 | protected function getInstructions() |
| 194 | 200 | { |
| 195 | - return array_filter( $this->metaboxes, function( $metabox ) { |
|
| 201 | + return array_filter( $this->metaboxes, function( $metabox ) |
|
| 202 | + { |
|
| 196 | 203 | return $this->verifyMetaBoxCondition( $metabox['condition'] ); |
| 197 | 204 | }); |
| 198 | 205 | } |