@@ -22,7 +22,9 @@ discard block |
||
22 | 22 | */ |
23 | 23 | protected function addInstructions() |
24 | 24 | { |
25 | - if( !$this->showInstructions() )return; |
|
25 | + if( !$this->showInstructions() ) { |
|
26 | + return; |
|
27 | + } |
|
26 | 28 | $this->normalize([ |
27 | 29 | 'infodiv' => [ |
28 | 30 | 'context' => 'side', |
@@ -43,8 +45,10 @@ discard block |
||
43 | 45 | */ |
44 | 46 | protected function generateInstructions() |
45 | 47 | { |
46 | - return array_reduce( $this->getInstructions(), function( $html, $metabox ) { |
|
47 | - $fields = array_reduce( $metabox['fields'], function( $html, $field ) use( $metabox ) { |
|
48 | + return array_reduce( $this->getInstructions(), function( $html, $metabox ) |
|
49 | + { |
|
50 | + $fields = array_reduce( $metabox['fields'], function( $html, $field ) use( $metabox ) |
|
51 | + { |
|
48 | 52 | if( !$this->validate( $field['condition'] )) { |
49 | 53 | return $html; |
50 | 54 | } |
@@ -63,7 +67,8 @@ discard block |
||
63 | 67 | */ |
64 | 68 | protected function getInstructions() |
65 | 69 | { |
66 | - return array_filter( $this->metaboxes, function( $metabox ) { |
|
70 | + return array_filter( $this->metaboxes, function( $metabox ) |
|
71 | + { |
|
67 | 72 | return $this->validate( $metabox['condition'] ) |
68 | 73 | && $this->hasPostType( $metabox ); |
69 | 74 | }); |
@@ -74,7 +79,8 @@ discard block |
||
74 | 79 | */ |
75 | 80 | protected function showInstructions() |
76 | 81 | { |
77 | - return count( array_filter( $this->metaboxes, function( $metabox ) { |
|
82 | + return count( array_filter( $this->metaboxes, function( $metabox ) |
|
83 | + { |
|
78 | 84 | return $this->show( false, $metabox ); |
79 | 85 | })) > 0; |
80 | 86 | } |