@@ -3,7 +3,8 @@ |
||
3 | 3 | /** |
4 | 4 | * Compatibility with Give WP plugin |
5 | 5 | */ |
6 | -add_filter( 'give_load_admin_scripts', function( $is_admin_page, $hook ) { |
|
6 | +add_filter( 'give_load_admin_scripts', function( $is_admin_page, $hook ) |
|
7 | +{ |
|
7 | 8 | $needle = sprintf( '_page_%s', filter_input( INPUT_GET, 'page' )); |
8 | 9 | return substr( $hook, - strlen( $needle )) !== $needle |
9 | 10 | ? $is_admin_page |
@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | $basename = plugin_basename( $this->file ); |
56 | 56 | $controller = $this->make( 'Controller' ); |
57 | 57 | |
58 | - add_action( 'plugins_loaded', function() { |
|
58 | + add_action( 'plugins_loaded', function() |
|
59 | + { |
|
59 | 60 | $this->bootstrap(); |
60 | 61 | }); |
61 | 62 | add_action( 'admin_enqueue_scripts', array( $controller, 'registerAssets' )); |
@@ -100,7 +101,9 @@ discard block |
||
100 | 101 | trailingslashit( dirname( dirname( ABSPATH ))), |
101 | 102 | ]); |
102 | 103 | foreach( (array) $locations as $location ) { |
103 | - if( !file_exists( $location . $filename ))continue; |
|
104 | + if( !file_exists( $location . $filename )) { |
|
105 | + continue; |
|
106 | + } |
|
104 | 107 | return $location . $filename; |
105 | 108 | } |
106 | 109 | return null; |
@@ -140,7 +143,9 @@ discard block |
||
140 | 143 | $view, |
141 | 144 | $data |
142 | 145 | ); |
143 | - if( !file_exists( $file ))return; |
|
146 | + if( !file_exists( $file )) { |
|
147 | + return; |
|
148 | + } |
|
144 | 149 | extract( $data ); |
145 | 150 | include $file; |
146 | 151 | } |