@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param string $plugin_name The name of this plugin. |
47 | 47 | * @param string $version The version of this plugin. |
48 | 48 | */ |
49 | - public function __construct( $plugin_name, $version ) { |
|
49 | + public function __construct($plugin_name, $version) { |
|
50 | 50 | |
51 | 51 | $this->plugin_name = $plugin_name; |
52 | 52 | $this->version = $version; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * class. |
73 | 73 | */ |
74 | 74 | |
75 | - wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpb-admin.css', array(), $this->version, 'all' ); |
|
75 | + wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/wpb-admin.css', array(), $this->version, 'all'); |
|
76 | 76 | |
77 | 77 | } |
78 | 78 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * class. |
96 | 96 | */ |
97 | 97 | |
98 | - wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpb-admin.js', array( 'jquery' ), $this->version, false ); |
|
98 | + wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/wpb-admin.js', array('jquery'), $this->version, false); |
|
99 | 99 | |
100 | 100 | } |
101 | 101 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @access public |
102 | 102 | */ |
103 | 103 | public function save() { |
104 | - add_action( 'admin_menu', array( $this, 'create_submenu' ) ); |
|
104 | + add_action('admin_menu', array($this, 'create_submenu')); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | * @param array $options Pass proprties as an array. |
112 | 112 | * @access public |
113 | 113 | */ |
114 | - public function make( $options = array() ) { |
|
115 | - foreach ( $options as $property => $value ) { |
|
116 | - if ( property_exists( $this, $property ) ) { |
|
114 | + public function make($options = array()) { |
|
115 | + foreach ($options as $property => $value) { |
|
116 | + if (property_exists($this, $property)) { |
|
117 | 117 | $this->{$property} = $value; |
118 | 118 | } |
119 | 119 | } |
120 | - add_action( 'admin_menu', array( $this, 'create_submenu' ) ); |
|
120 | + add_action('admin_menu', array($this, 'create_submenu')); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return void |
127 | 127 | */ |
128 | 128 | public function create_submenu() { |
129 | - if ( current_user_can( $this->capability ) ) { |
|
129 | + if (current_user_can($this->capability)) { |
|
130 | 130 | $hook = add_submenu_page( |
131 | 131 | $this->parent_slug, |
132 | 132 | $this->page_title, |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ); |
139 | 139 | } |
140 | 140 | |
141 | - add_action( 'load-' . $hook, array( $this, 'init_hooks' ) ); |
|
141 | + add_action('load-'.$hook, array($this, 'init_hooks')); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @return void |
148 | 148 | */ |
149 | 149 | public function init_hooks() { |
150 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
150 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | * @return void |
157 | 157 | */ |
158 | 158 | public function enqueue_scripts() { |
159 | - wp_enqueue_style( $this->plugin_name . '-vendors' ); |
|
160 | - wp_enqueue_style( $this->plugin_name . '-admin' ); |
|
161 | - wp_enqueue_script( $this->plugin_name . '-admin' ); |
|
159 | + wp_enqueue_style($this->plugin_name.'-vendors'); |
|
160 | + wp_enqueue_style($this->plugin_name.'-admin'); |
|
161 | + wp_enqueue_script($this->plugin_name.'-admin'); |
|
162 | 162 | } |
163 | 163 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @access public |
101 | 101 | */ |
102 | 102 | public function save() { |
103 | - add_action( 'admin_menu', array( $this, 'create_menu' ) ); |
|
103 | + add_action('admin_menu', array($this, 'create_menu')); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | * @param array $options Pass proprties as an array. |
111 | 111 | * @access public |
112 | 112 | */ |
113 | - public function make( $options = array() ) { |
|
114 | - foreach ( $options as $property => $value ) { |
|
115 | - if ( property_exists( get_called_class(), $property ) ) { |
|
113 | + public function make($options = array()) { |
|
114 | + foreach ($options as $property => $value) { |
|
115 | + if (property_exists(get_called_class(), $property)) { |
|
116 | 116 | $this->{$property} = $value; |
117 | 117 | } |
118 | 118 | } |
119 | - add_action( 'admin_menu', array( $this, 'create_menu' ) ); |
|
119 | + add_action('admin_menu', array($this, 'create_menu')); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $this->icon |
135 | 135 | ); |
136 | 136 | |
137 | - add_action( 'load-' . $hook, array( $this, 'init_hooks' ) ); |
|
137 | + add_action('load-'.$hook, array($this, 'init_hooks')); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return void |
144 | 144 | */ |
145 | 145 | public function init_hooks() { |
146 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
146 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | * @return void |
153 | 153 | */ |
154 | 154 | public function enqueue_scripts() { |
155 | - wp_enqueue_style( $this->plugin_name . '-vendors' ); |
|
156 | - wp_enqueue_style( $this->plugin_name . '-admin' ); |
|
157 | - wp_enqueue_script( $this->plugin_name . '-admin' ); |
|
155 | + wp_enqueue_style($this->plugin_name.'-vendors'); |
|
156 | + wp_enqueue_style($this->plugin_name.'-admin'); |
|
157 | + wp_enqueue_script($this->plugin_name.'-admin'); |
|
158 | 158 | } |
159 | 159 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | |
18 | 18 | $router->get( |
19 | 19 | 'test', |
20 | - function( Request $request ) { |
|
20 | + function(Request $request) { |
|
21 | 21 | echo 'API Test'; |
22 | 22 | die(); |
23 | 23 | } |
@@ -18,14 +18,14 @@ |
||
18 | 18 | $router->get( |
19 | 19 | 'test', |
20 | 20 | function() { |
21 | - echo wpb_view( 'welcome' ); |
|
21 | + echo wpb_view('welcome'); |
|
22 | 22 | die(); |
23 | 23 | } |
24 | 24 | ); |
25 | 25 | |
26 | 26 | Route::get( |
27 | 27 | 'test/facade', |
28 | - function( Request $request ) { |
|
28 | + function(Request $request) { |
|
29 | 29 | echo 'This is a facade route'; |
30 | 30 | die(); |
31 | 31 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | return array( |
13 | 13 | 'paths' => array( |
14 | - __DIR__ . '/../resources/views', |
|
14 | + __DIR__.'/../resources/views', |
|
15 | 15 | ), |
16 | - 'compiled' => __DIR__ . '/../storage/cache', |
|
16 | + 'compiled' => __DIR__.'/../storage/cache', |
|
17 | 17 | ); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | return array( |
13 | 13 | 'paths' => array( |
14 | - 'migrations' => __DIR__ . '/../database/migrations', |
|
15 | - 'seeds' => __DIR__ . '/../database/seeds', |
|
14 | + 'migrations' => __DIR__.'/../database/migrations', |
|
15 | + 'seeds' => __DIR__.'/../database/seeds', |
|
16 | 16 | ), |
17 | 17 | ); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $this->define_constants(); |
71 | 71 | |
72 | - if ( defined( 'WPB_VERSION' ) ) { |
|
72 | + if (defined('WPB_VERSION')) { |
|
73 | 73 | $this->version = WPB_VERSION; |
74 | 74 | } else { |
75 | 75 | $this->version = '1.0.0'; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $menu->capability = 'manage_options'; |
89 | 89 | $menu->slug = 'wpb'; |
90 | 90 | $menu->callback = function() { |
91 | - echo '<div class="wrap"><div id="wpb-admin" base-url="' . esc_attr( get_site_url() ) . '" csrf-token="' . esc_attr( wpb_csrf_token() ) . '"></div></div>'; |
|
91 | + echo '<div class="wrap"><div id="wpb-admin" base-url="'.esc_attr(get_site_url()).'" csrf-token="'.esc_attr(wpb_csrf_token()).'"></div></div>'; |
|
92 | 92 | }; |
93 | 93 | $menu->icon = 'dashicons-text'; |
94 | 94 | $menu->save(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $submenu->page_title = 'Settings'; |
100 | 100 | $submenu->menu_title = 'Settings'; |
101 | 101 | $submenu->capability = 'manage_options'; |
102 | - $submenu->slug = 'admin.php?page=' . $menu->slug . '#/settings'; |
|
102 | + $submenu->slug = 'admin.php?page='.$menu->slug.'#/settings'; |
|
103 | 103 | $submenu->save(); |
104 | 104 | } |
105 | 105 | |
@@ -125,34 +125,34 @@ discard block |
||
125 | 125 | * The class responsible for orchestrating the actions and filters of the |
126 | 126 | * core plugin. |
127 | 127 | */ |
128 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wpb-loader.php'; |
|
128 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wpb-loader.php'; |
|
129 | 129 | |
130 | 130 | /** |
131 | 131 | * The class responsible for defining internationalization functionality |
132 | 132 | * of the plugin. |
133 | 133 | */ |
134 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wpb-i18n.php'; |
|
134 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wpb-i18n.php'; |
|
135 | 135 | |
136 | 136 | /** |
137 | 137 | * The class responsible for defining all actions that occur in the admin area. |
138 | 138 | */ |
139 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpb-admin.php'; |
|
139 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wpb-admin.php'; |
|
140 | 140 | |
141 | 141 | /** |
142 | 142 | * The class responsible for defining all menu actions that occur in the admin area. |
143 | 143 | */ |
144 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpb-admin-menu.php'; |
|
144 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wpb-admin-menu.php'; |
|
145 | 145 | |
146 | 146 | /** |
147 | 147 | * The class responsible for defining all submenu actions that occur in the admin area. |
148 | 148 | */ |
149 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpb-admin-submenu.php'; |
|
149 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wpb-admin-submenu.php'; |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * The class responsible for defining all actions that occur in the public-facing |
153 | 153 | * side of the site. |
154 | 154 | */ |
155 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wpb-public.php'; |
|
155 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wpb-public.php'; |
|
156 | 156 | |
157 | 157 | $this->loader = new WPB_Loader(); |
158 | 158 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | $plugin_i18n = new WPB_I18n(); |
173 | 173 | |
174 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
174 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
175 | 175 | |
176 | 176 | } |
177 | 177 | |
@@ -184,10 +184,10 @@ discard block |
||
184 | 184 | */ |
185 | 185 | private function define_admin_hooks() { |
186 | 186 | |
187 | - $plugin_admin = new WPB_Admin( $this->get_plugin_name(), $this->get_version() ); |
|
187 | + $plugin_admin = new WPB_Admin($this->get_plugin_name(), $this->get_version()); |
|
188 | 188 | |
189 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
190 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
189 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
190 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
|
191 | 191 | |
192 | 192 | } |
193 | 193 | |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | */ |
201 | 201 | private function define_public_hooks() { |
202 | 202 | |
203 | - $plugin_public = new WPB_Public( $this->get_plugin_name(), $this->get_version() ); |
|
203 | + $plugin_public = new WPB_Public($this->get_plugin_name(), $this->get_version()); |
|
204 | 204 | |
205 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
206 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
205 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
206 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
207 | 207 | |
208 | 208 | } |
209 | 209 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @return void |
254 | 254 | */ |
255 | 255 | public function define_constants() { |
256 | - define( 'WPB_VERSION', $this->version ); |
|
256 | + define('WPB_VERSION', $this->version); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | * @return void |
263 | 263 | */ |
264 | 264 | public function register_assets() { |
265 | - $this->register_scripts( $this->get_scripts() ); |
|
266 | - $this->register_styles( $this->get_styles() ); |
|
265 | + $this->register_scripts($this->get_scripts()); |
|
266 | + $this->register_styles($this->get_styles()); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -273,13 +273,13 @@ discard block |
||
273 | 273 | * |
274 | 274 | * @return void |
275 | 275 | */ |
276 | - private function register_scripts( $scripts ) { |
|
277 | - foreach ( $scripts as $handle => $script ) { |
|
278 | - $deps = isset( $script['deps'] ) ? $script['deps'] : false; |
|
279 | - $in_footer = isset( $script['in_footer'] ) ? $script['in_footer'] : false; |
|
280 | - $version = isset( $script['version'] ) ? $script['version'] : WPB_VERSION; |
|
276 | + private function register_scripts($scripts) { |
|
277 | + foreach ($scripts as $handle => $script) { |
|
278 | + $deps = isset($script['deps']) ? $script['deps'] : false; |
|
279 | + $in_footer = isset($script['in_footer']) ? $script['in_footer'] : false; |
|
280 | + $version = isset($script['version']) ? $script['version'] : WPB_VERSION; |
|
281 | 281 | |
282 | - wp_register_script( $handle, $script['src'], $deps, $version, $in_footer ); |
|
282 | + wp_register_script($handle, $script['src'], $deps, $version, $in_footer); |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
@@ -290,11 +290,11 @@ discard block |
||
290 | 290 | * |
291 | 291 | * @return void |
292 | 292 | */ |
293 | - public function register_styles( $styles ) { |
|
294 | - foreach ( $styles as $handle => $style ) { |
|
295 | - $deps = isset( $style['deps'] ) ? $style['deps'] : false; |
|
293 | + public function register_styles($styles) { |
|
294 | + foreach ($styles as $handle => $style) { |
|
295 | + $deps = isset($style['deps']) ? $style['deps'] : false; |
|
296 | 296 | |
297 | - wp_register_style( $handle, $style['src'], $deps, WPB_VERSION ); |
|
297 | + wp_register_style($handle, $style['src'], $deps, WPB_VERSION); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | |
@@ -305,35 +305,35 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function get_scripts() { |
307 | 307 | |
308 | - $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.min' : ''; |
|
308 | + $prefix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.min' : ''; |
|
309 | 309 | |
310 | 310 | $scripts = array( |
311 | 311 | 'wpb-runtime' => array( |
312 | - 'src' => WPB_ASSETS . '/js/runtime.js', |
|
313 | - 'version' => filemtime( WPB_PATH . '/public/js/runtime.js' ), |
|
312 | + 'src' => WPB_ASSETS.'/js/runtime.js', |
|
313 | + 'version' => filemtime(WPB_PATH.'/public/js/runtime.js'), |
|
314 | 314 | 'in_footer' => true, |
315 | 315 | ), |
316 | 316 | 'wpb-vendor' => array( |
317 | - 'src' => WPB_ASSETS . '/js/vendors.js', |
|
318 | - 'version' => filemtime( WPB_PATH . '/public/js/vendors.js' ), |
|
317 | + 'src' => WPB_ASSETS.'/js/vendors.js', |
|
318 | + 'version' => filemtime(WPB_PATH.'/public/js/vendors.js'), |
|
319 | 319 | 'in_footer' => true, |
320 | 320 | ), |
321 | 321 | 'wpb-frontend' => array( |
322 | - 'src' => WPB_ASSETS . '/js/frontend.js', |
|
323 | - 'deps' => array( 'jquery', 'wpb-vendor', 'wpb-runtime' ), |
|
324 | - 'version' => filemtime( WPB_PATH . '/public/js/frontend.js' ), |
|
322 | + 'src' => WPB_ASSETS.'/js/frontend.js', |
|
323 | + 'deps' => array('jquery', 'wpb-vendor', 'wpb-runtime'), |
|
324 | + 'version' => filemtime(WPB_PATH.'/public/js/frontend.js'), |
|
325 | 325 | 'in_footer' => true, |
326 | 326 | ), |
327 | 327 | 'wpb-admin' => array( |
328 | - 'src' => WPB_ASSETS . '/js/admin.js', |
|
329 | - 'deps' => array( 'jquery', 'wpb-vendor', 'wpb-runtime' ), |
|
330 | - 'version' => filemtime( WPB_PATH . '/public/js/admin.js' ), |
|
328 | + 'src' => WPB_ASSETS.'/js/admin.js', |
|
329 | + 'deps' => array('jquery', 'wpb-vendor', 'wpb-runtime'), |
|
330 | + 'version' => filemtime(WPB_PATH.'/public/js/admin.js'), |
|
331 | 331 | 'in_footer' => true, |
332 | 332 | ), |
333 | 333 | 'wpb-spa' => array( |
334 | - 'src' => WPB_ASSETS . '/js/spa.js', |
|
335 | - 'deps' => array( 'jquery', 'wpb-vendor', 'wpb-runtime' ), |
|
336 | - 'version' => filemtime( WPB_PATH . '/public/js/spa.js' ), |
|
334 | + 'src' => WPB_ASSETS.'/js/spa.js', |
|
335 | + 'deps' => array('jquery', 'wpb-vendor', 'wpb-runtime'), |
|
336 | + 'version' => filemtime(WPB_PATH.'/public/js/spa.js'), |
|
337 | 337 | 'in_footer' => true, |
338 | 338 | ), |
339 | 339 | ); |
@@ -350,19 +350,19 @@ discard block |
||
350 | 350 | |
351 | 351 | $styles = array( |
352 | 352 | 'wpb-style' => array( |
353 | - 'src' => WPB_ASSETS . '/css/style.css', |
|
353 | + 'src' => WPB_ASSETS.'/css/style.css', |
|
354 | 354 | ), |
355 | 355 | 'wpb-frontend' => array( |
356 | - 'src' => WPB_ASSETS . '/css/frontend.css', |
|
356 | + 'src' => WPB_ASSETS.'/css/frontend.css', |
|
357 | 357 | ), |
358 | 358 | 'wpb-admin' => array( |
359 | - 'src' => WPB_ASSETS . '/css/admin.css', |
|
359 | + 'src' => WPB_ASSETS.'/css/admin.css', |
|
360 | 360 | ), |
361 | 361 | 'wpb-spa' => array( |
362 | - 'src' => WPB_ASSETS . '/css/spa.css', |
|
362 | + 'src' => WPB_ASSETS.'/css/spa.css', |
|
363 | 363 | ), |
364 | 364 | 'wpb-vendors' => array( |
365 | - 'src' => WPB_ASSETS . '/css/vendors.css', |
|
365 | + 'src' => WPB_ASSETS.'/css/vendors.css', |
|
366 | 366 | ), |
367 | 367 | ); |
368 | 368 |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | * @param int $priority Optional. The priority at which the function should be fired. Default is 10. |
63 | 63 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
64 | 64 | */ |
65 | - public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
66 | - $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); |
|
65 | + public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) { |
|
66 | + $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | * @param int $priority Optional. The priority at which the function should be fired. Default is 10. |
77 | 77 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
78 | 78 | */ |
79 | - public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
80 | - $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); |
|
79 | + public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) { |
|
80 | + $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param int $accepted_args The number of arguments that should be passed to the $callback. |
95 | 95 | * @return array The collection of actions and filters registered with WordPress. |
96 | 96 | */ |
97 | - private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
|
97 | + private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) { |
|
98 | 98 | |
99 | 99 | $hooks[] = array( |
100 | 100 | 'hook' => $hook, |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function run() { |
117 | 117 | |
118 | - foreach ( $this->filters as $hook ) { |
|
119 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
118 | + foreach ($this->filters as $hook) { |
|
119 | + add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); |
|
120 | 120 | } |
121 | 121 | |
122 | - foreach ( $this->actions as $hook ) { |
|
123 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
122 | + foreach ($this->actions as $hook) { |
|
123 | + add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | } |