@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | - public function apply( Builder $builder, Model $model ) { |
|
| 37 | - $builder->whereNull( 'post_author' ); |
|
| 36 | + public function apply(Builder $builder, Model $model) { |
|
| 37 | + $builder->whereNull('post_author'); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | - public function apply( Builder $builder, Model $model ) { |
|
| 37 | - $builder->where( 'post_type', '=', 'post' ); |
|
| 36 | + public function apply(Builder $builder, Model $model) { |
|
| 37 | + $builder->where('post_type', '=', 'post'); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | - public function apply( Builder $builder, Model $model ) { |
|
| 37 | - $builder->where( 'post_status', '=', 'publish' ); |
|
| 36 | + public function apply(Builder $builder, Model $model) { |
|
| 37 | + $builder->where('post_status', '=', 'publish'); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * @return null|\WPB\Database\DB |
| 42 | 42 | */ |
| 43 | 43 | public static function instance() { |
| 44 | - if ( ! static::$instance ) { |
|
| 44 | + if (!static::$instance) { |
|
| 45 | 45 | static::$instance = new self(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | * @param \Composer\Script\Event $event The composer event. |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | - public static function post_install( Event $event ) { |
|
| 36 | - require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php'; |
|
| 35 | + public static function post_install(Event $event) { |
|
| 36 | + require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | * @param \Composer\Script\Event $event The composer event. |
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | - public static function post_update( Event $event ) { |
|
| 46 | - require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php'; |
|
| 45 | + public static function post_update(Event $event) { |
|
| 46 | + require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -52,20 +52,20 @@ discard block |
||
| 52 | 52 | * @param \Composer\Script\Event $event The composer event. |
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | - public static function post_autoload_dump( Event $event ) { |
|
| 56 | - require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php'; |
|
| 55 | + public static function post_autoload_dump(Event $event) { |
|
| 56 | + require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; |
|
| 57 | 57 | |
| 58 | - $dir = $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/../'; |
|
| 59 | - $root = dirname( $event->getComposer()->getConfig()->get( 'vendor-dir' ) ); |
|
| 58 | + $dir = $event->getComposer()->getConfig()->get('vendor-dir').'/../'; |
|
| 59 | + $root = dirname($event->getComposer()->getConfig()->get('vendor-dir')); |
|
| 60 | 60 | |
| 61 | - $vendor_name = strtolower( basename( $root ) ); |
|
| 62 | - $partials = explode( '-', $vendor_name ); |
|
| 61 | + $vendor_name = strtolower(basename($root)); |
|
| 62 | + $partials = explode('-', $vendor_name); |
|
| 63 | 63 | $camel_case_partials = array(); |
| 64 | - foreach ( $partials as $partial ) { |
|
| 65 | - $camel_case_partials[] = ucfirst( strtolower( $partial ) ); |
|
| 64 | + foreach ($partials as $partial) { |
|
| 65 | + $camel_case_partials[] = ucfirst(strtolower($partial)); |
|
| 66 | 66 | } |
| 67 | - $camel_case = implode( '_', $camel_case_partials ); |
|
| 68 | - $snake_case = implode( '_', $partials ); |
|
| 67 | + $camel_case = implode('_', $camel_case_partials); |
|
| 68 | + $snake_case = implode('_', $partials); |
|
| 69 | 69 | |
| 70 | 70 | $files = array( |
| 71 | 71 | '/admin/class-wpb-admin.php', |
@@ -113,36 +113,36 @@ discard block |
||
| 113 | 113 | '/wpb.php', |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | - foreach ( $files as $file ) { |
|
| 117 | - $file = $root . $file; |
|
| 118 | - if ( file_exists( $file ) ) { |
|
| 119 | - $contents = get_contents( $file ); |
|
| 120 | - $contents = str_replace( 'wpb_', $snake_case . '_', $contents ); |
|
| 121 | - $contents = str_replace( 'wpb', $vendor_name, $contents ); |
|
| 122 | - $contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents ); |
|
| 123 | - $contents = str_replace( 'WPB_FILE', strtoupper( $camel_case ) . '_FILE', $contents ); |
|
| 124 | - $contents = str_replace( 'WPB_PATH', strtoupper( $camel_case ) . '_PATH', $contents ); |
|
| 125 | - $contents = str_replace( 'WPB_INCLUDES', strtoupper( $camel_case ) . '_INCLUDES', $contents ); |
|
| 126 | - $contents = str_replace( 'WPB_URL', strtoupper( $camel_case ) . '_URL', $contents ); |
|
| 127 | - $contents = str_replace( 'WPB_ASSETS', strtoupper( $camel_case ) . '_ASSETS', $contents ); |
|
| 128 | - $contents = str_replace( 'WPB_VERSION', strtoupper( $camel_case ) . '_VERSION', $contents ); |
|
| 129 | - $contents = str_replace( 'WPB', $camel_case, $contents ); |
|
| 116 | + foreach ($files as $file) { |
|
| 117 | + $file = $root.$file; |
|
| 118 | + if (file_exists($file)) { |
|
| 119 | + $contents = get_contents($file); |
|
| 120 | + $contents = str_replace('wpb_', $snake_case.'_', $contents); |
|
| 121 | + $contents = str_replace('wpb', $vendor_name, $contents); |
|
| 122 | + $contents = str_replace('WPB_APP_ROOT', strtoupper($camel_case).'_APP_ROOT', $contents); |
|
| 123 | + $contents = str_replace('WPB_FILE', strtoupper($camel_case).'_FILE', $contents); |
|
| 124 | + $contents = str_replace('WPB_PATH', strtoupper($camel_case).'_PATH', $contents); |
|
| 125 | + $contents = str_replace('WPB_INCLUDES', strtoupper($camel_case).'_INCLUDES', $contents); |
|
| 126 | + $contents = str_replace('WPB_URL', strtoupper($camel_case).'_URL', $contents); |
|
| 127 | + $contents = str_replace('WPB_ASSETS', strtoupper($camel_case).'_ASSETS', $contents); |
|
| 128 | + $contents = str_replace('WPB_VERSION', strtoupper($camel_case).'_VERSION', $contents); |
|
| 129 | + $contents = str_replace('WPB', $camel_case, $contents); |
|
| 130 | 130 | put_contents( |
| 131 | 131 | $file, |
| 132 | 132 | $contents |
| 133 | 133 | ); |
| 134 | 134 | |
| 135 | - $dir = dirname( $file ); |
|
| 136 | - $file_name = basename( $file ); |
|
| 137 | - $new_file_name = str_replace( 'wpb', $vendor_name, $file_name ); |
|
| 135 | + $dir = dirname($file); |
|
| 136 | + $file_name = basename($file); |
|
| 137 | + $new_file_name = str_replace('wpb', $vendor_name, $file_name); |
|
| 138 | 138 | |
| 139 | - if ( $file_name !== $new_file_name ) { |
|
| 140 | - rename( $file, $dir . '/' . $new_file_name ); |
|
| 139 | + if ($file_name !== $new_file_name) { |
|
| 140 | + rename($file, $dir.'/'.$new_file_name); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - static::update_bootstrap( $root, $camel_case ); |
|
| 145 | + static::update_bootstrap($root, $camel_case); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | * |
| 157 | 157 | * @return void |
| 158 | 158 | */ |
| 159 | - protected static function update_bootstrap( $root, $camel_case ) { |
|
| 160 | - $file = $root . '/bootstrap/app.php'; |
|
| 161 | - if ( file_exists( $file ) ) { |
|
| 162 | - $contents = get_contents( $file ); |
|
| 163 | - $contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents ); |
|
| 159 | + protected static function update_bootstrap($root, $camel_case) { |
|
| 160 | + $file = $root.'/bootstrap/app.php'; |
|
| 161 | + if (file_exists($file)) { |
|
| 162 | + $contents = get_contents($file); |
|
| 163 | + $contents = str_replace('WPB_APP_ROOT', strtoupper($camel_case).'_APP_ROOT', $contents); |
|
| 164 | 164 | put_contents( |
| 165 | 165 | $file, |
| 166 | 166 | $contents |
@@ -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'; |
@@ -81,23 +81,23 @@ discard block |
||
| 81 | 81 | $this->define_public_hooks(); |
| 82 | 82 | $this->register_assets(); |
| 83 | 83 | |
| 84 | - $menu = new WPB_Admin_Menu( $this->plugin_name ); |
|
| 84 | + $menu = new WPB_Admin_Menu($this->plugin_name); |
|
| 85 | 85 | $menu->page_title = 'WPB'; |
| 86 | 86 | $menu->menu_title = 'WPB'; |
| 87 | 87 | $menu->capability = 'manage_options'; |
| 88 | 88 | $menu->slug = 'wpb'; |
| 89 | 89 | $menu->callback = function() { |
| 90 | - echo '<div class="wrap"><div id="wpb-admin" base-url="' . esc_attr( get_site_url() ) . '" csrf-token="' . esc_attr( wpb_csrf_token() ) . '"></div></div>'; |
|
| 90 | + 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 | 91 | }; |
| 92 | 92 | $menu->icon = 'dashicons-text'; |
| 93 | 93 | $menu->save(); |
| 94 | 94 | |
| 95 | - $submenu = new WPB_Admin_SubMenu( $this->plugin_name ); |
|
| 95 | + $submenu = new WPB_Admin_SubMenu($this->plugin_name); |
|
| 96 | 96 | $submenu->parent_slug = $menu->slug; |
| 97 | 97 | $submenu->page_title = 'Settings'; |
| 98 | 98 | $submenu->menu_title = 'Settings'; |
| 99 | 99 | $submenu->capability = 'manage_options'; |
| 100 | - $submenu->slug = 'admin.php?page=' . $menu->slug . '#/settings'; |
|
| 100 | + $submenu->slug = 'admin.php?page='.$menu->slug.'#/settings'; |
|
| 101 | 101 | $submenu->save(); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -123,34 +123,34 @@ discard block |
||
| 123 | 123 | * The class responsible for orchestrating the actions and filters of the |
| 124 | 124 | * core plugin. |
| 125 | 125 | */ |
| 126 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wpb-loader.php'; |
|
| 126 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wpb-loader.php'; |
|
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | 129 | * The class responsible for defining internationalization functionality |
| 130 | 130 | * of the plugin. |
| 131 | 131 | */ |
| 132 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wpb-i18n.php'; |
|
| 132 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wpb-i18n.php'; |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * The class responsible for defining all actions that occur in the admin area. |
| 136 | 136 | */ |
| 137 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpb-admin.php'; |
|
| 137 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wpb-admin.php'; |
|
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | 140 | * The class responsible for defining all menu actions that occur in the admin area. |
| 141 | 141 | */ |
| 142 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpb-admin-menu.php'; |
|
| 142 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wpb-admin-menu.php'; |
|
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | 145 | * The class responsible for defining all submenu actions that occur in the admin area. |
| 146 | 146 | */ |
| 147 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpb-admin-submenu.php'; |
|
| 147 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wpb-admin-submenu.php'; |
|
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | 150 | * The class responsible for defining all actions that occur in the public-facing |
| 151 | 151 | * side of the site. |
| 152 | 152 | */ |
| 153 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wpb-public.php'; |
|
| 153 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wpb-public.php'; |
|
| 154 | 154 | |
| 155 | 155 | $this->loader = new WPB_Loader(); |
| 156 | 156 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $plugin_i18n = new WPB_I18n(); |
| 171 | 171 | |
| 172 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 172 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 173 | 173 | |
| 174 | 174 | } |
| 175 | 175 | |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | private function define_admin_hooks() { |
| 184 | 184 | |
| 185 | - $plugin_admin = new WPB_Admin( $this->get_plugin_name(), $this->get_version() ); |
|
| 185 | + $plugin_admin = new WPB_Admin($this->get_plugin_name(), $this->get_version()); |
|
| 186 | 186 | |
| 187 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 188 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 187 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 188 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
@@ -198,10 +198,10 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | private function define_public_hooks() { |
| 200 | 200 | |
| 201 | - $plugin_public = new WPB_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 201 | + $plugin_public = new WPB_Public($this->get_plugin_name(), $this->get_version()); |
|
| 202 | 202 | |
| 203 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 204 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 203 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 204 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 205 | 205 | |
| 206 | 206 | } |
| 207 | 207 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * @return void |
| 252 | 252 | */ |
| 253 | 253 | public function define_constants() { |
| 254 | - define( 'WPB_VERSION', $this->version ); |
|
| 254 | + define('WPB_VERSION', $this->version); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | * @return void |
| 261 | 261 | */ |
| 262 | 262 | public function register_assets() { |
| 263 | - $this->register_scripts( $this->get_scripts() ); |
|
| 264 | - $this->register_styles( $this->get_styles() ); |
|
| 263 | + $this->register_scripts($this->get_scripts()); |
|
| 264 | + $this->register_styles($this->get_styles()); |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | /** |
@@ -271,13 +271,13 @@ discard block |
||
| 271 | 271 | * |
| 272 | 272 | * @return void |
| 273 | 273 | */ |
| 274 | - private function register_scripts( $scripts ) { |
|
| 275 | - foreach ( $scripts as $handle => $script ) { |
|
| 276 | - $deps = isset( $script['deps'] ) ? $script['deps'] : false; |
|
| 277 | - $in_footer = isset( $script['in_footer'] ) ? $script['in_footer'] : false; |
|
| 278 | - $version = isset( $script['version'] ) ? $script['version'] : WPB_VERSION; |
|
| 274 | + private function register_scripts($scripts) { |
|
| 275 | + foreach ($scripts as $handle => $script) { |
|
| 276 | + $deps = isset($script['deps']) ? $script['deps'] : false; |
|
| 277 | + $in_footer = isset($script['in_footer']) ? $script['in_footer'] : false; |
|
| 278 | + $version = isset($script['version']) ? $script['version'] : WPB_VERSION; |
|
| 279 | 279 | |
| 280 | - wp_register_script( $handle, $script['src'], $deps, $version, $in_footer ); |
|
| 280 | + wp_register_script($handle, $script['src'], $deps, $version, $in_footer); |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | |
@@ -288,11 +288,11 @@ discard block |
||
| 288 | 288 | * |
| 289 | 289 | * @return void |
| 290 | 290 | */ |
| 291 | - public function register_styles( $styles ) { |
|
| 292 | - foreach ( $styles as $handle => $style ) { |
|
| 293 | - $deps = isset( $style['deps'] ) ? $style['deps'] : false; |
|
| 291 | + public function register_styles($styles) { |
|
| 292 | + foreach ($styles as $handle => $style) { |
|
| 293 | + $deps = isset($style['deps']) ? $style['deps'] : false; |
|
| 294 | 294 | |
| 295 | - wp_register_style( $handle, $style['src'], $deps, WPB_VERSION ); |
|
| 295 | + wp_register_style($handle, $style['src'], $deps, WPB_VERSION); |
|
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
@@ -303,35 +303,35 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | public function get_scripts() { |
| 305 | 305 | |
| 306 | - $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.min' : ''; |
|
| 306 | + $prefix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.min' : ''; |
|
| 307 | 307 | |
| 308 | 308 | $scripts = array( |
| 309 | 309 | 'wpb-runtime' => array( |
| 310 | - 'src' => WPB_ASSETS . '/js/runtime.js', |
|
| 311 | - 'version' => filemtime( WPB_PATH . '/public/js/runtime.js' ), |
|
| 310 | + 'src' => WPB_ASSETS.'/js/runtime.js', |
|
| 311 | + 'version' => filemtime(WPB_PATH.'/public/js/runtime.js'), |
|
| 312 | 312 | 'in_footer' => true, |
| 313 | 313 | ), |
| 314 | 314 | 'wpb-vendor' => array( |
| 315 | - 'src' => WPB_ASSETS . '/js/vendors.js', |
|
| 316 | - 'version' => filemtime( WPB_PATH . '/public/js/vendors.js' ), |
|
| 315 | + 'src' => WPB_ASSETS.'/js/vendors.js', |
|
| 316 | + 'version' => filemtime(WPB_PATH.'/public/js/vendors.js'), |
|
| 317 | 317 | 'in_footer' => true, |
| 318 | 318 | ), |
| 319 | 319 | 'wpb-frontend' => array( |
| 320 | - 'src' => WPB_ASSETS . '/js/frontend.js', |
|
| 321 | - 'deps' => array( 'jquery', 'wpb-vendor', 'wpb-runtime' ), |
|
| 322 | - 'version' => filemtime( WPB_PATH . '/public/js/frontend.js' ), |
|
| 320 | + 'src' => WPB_ASSETS.'/js/frontend.js', |
|
| 321 | + 'deps' => array('jquery', 'wpb-vendor', 'wpb-runtime'), |
|
| 322 | + 'version' => filemtime(WPB_PATH.'/public/js/frontend.js'), |
|
| 323 | 323 | 'in_footer' => true, |
| 324 | 324 | ), |
| 325 | 325 | 'wpb-admin' => array( |
| 326 | - 'src' => WPB_ASSETS . '/js/admin.js', |
|
| 327 | - 'deps' => array( 'jquery', 'wpb-vendor', 'wpb-runtime' ), |
|
| 328 | - 'version' => filemtime( WPB_PATH . '/public/js/admin.js' ), |
|
| 326 | + 'src' => WPB_ASSETS.'/js/admin.js', |
|
| 327 | + 'deps' => array('jquery', 'wpb-vendor', 'wpb-runtime'), |
|
| 328 | + 'version' => filemtime(WPB_PATH.'/public/js/admin.js'), |
|
| 329 | 329 | 'in_footer' => true, |
| 330 | 330 | ), |
| 331 | 331 | 'wpb-spa' => array( |
| 332 | - 'src' => WPB_ASSETS . '/js/spa.js', |
|
| 333 | - 'deps' => array( 'jquery', 'wpb-vendor', 'wpb-runtime' ), |
|
| 334 | - 'version' => filemtime( WPB_PATH . '/public/js/spa.js' ), |
|
| 332 | + 'src' => WPB_ASSETS.'/js/spa.js', |
|
| 333 | + 'deps' => array('jquery', 'wpb-vendor', 'wpb-runtime'), |
|
| 334 | + 'version' => filemtime(WPB_PATH.'/public/js/spa.js'), |
|
| 335 | 335 | 'in_footer' => true, |
| 336 | 336 | ), |
| 337 | 337 | ); |
@@ -348,19 +348,19 @@ discard block |
||
| 348 | 348 | |
| 349 | 349 | $styles = array( |
| 350 | 350 | 'wpb-style' => array( |
| 351 | - 'src' => WPB_ASSETS . '/css/style.css', |
|
| 351 | + 'src' => WPB_ASSETS.'/css/style.css', |
|
| 352 | 352 | ), |
| 353 | 353 | 'wpb-frontend' => array( |
| 354 | - 'src' => WPB_ASSETS . '/css/frontend.css', |
|
| 354 | + 'src' => WPB_ASSETS.'/css/frontend.css', |
|
| 355 | 355 | ), |
| 356 | 356 | 'wpb-admin' => array( |
| 357 | - 'src' => WPB_ASSETS . '/css/admin.css', |
|
| 357 | + 'src' => WPB_ASSETS.'/css/admin.css', |
|
| 358 | 358 | ), |
| 359 | 359 | 'wpb-spa' => array( |
| 360 | - 'src' => WPB_ASSETS . '/css/spa.css', |
|
| 360 | + 'src' => WPB_ASSETS.'/css/spa.css', |
|
| 361 | 361 | ), |
| 362 | 362 | 'wpb-vendors' => array( |
| 363 | - 'src' => WPB_ASSETS . '/css/vendors.css', |
|
| 363 | + 'src' => WPB_ASSETS.'/css/vendors.css', |
|
| 364 | 364 | ), |
| 365 | 365 | ); |
| 366 | 366 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @since 1.0.0 |
| 101 | 101 | * @access public |
| 102 | 102 | */ |
| 103 | - public function __construct( $plugin_name ) { |
|
| 103 | + public function __construct($plugin_name) { |
|
| 104 | 104 | $this->plugin_name = $plugin_name; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @access public |
| 112 | 112 | */ |
| 113 | 113 | public function save() { |
| 114 | - add_action( 'admin_menu', array( $this, 'create_menu' ) ); |
|
| 114 | + add_action('admin_menu', array($this, 'create_menu')); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | * @param array $options Pass proprties as an array. |
| 122 | 122 | * @access public |
| 123 | 123 | */ |
| 124 | - public function make( $options = array() ) { |
|
| 125 | - foreach ( $options as $property => $value ) { |
|
| 126 | - if ( property_exists( get_called_class(), $property ) ) { |
|
| 124 | + public function make($options = array()) { |
|
| 125 | + foreach ($options as $property => $value) { |
|
| 126 | + if (property_exists(get_called_class(), $property)) { |
|
| 127 | 127 | $this->{$property} = $value; |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | - add_action( 'admin_menu', array( $this, 'create_menu' ) ); |
|
| 130 | + add_action('admin_menu', array($this, 'create_menu')); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $this->icon |
| 146 | 146 | ); |
| 147 | 147 | |
| 148 | - add_action( 'load-' . $hook, array( $this, 'init_hooks' ) ); |
|
| 148 | + add_action('load-'.$hook, array($this, 'init_hooks')); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | * @return void |
| 155 | 155 | */ |
| 156 | 156 | public function init_hooks() { |
| 157 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
| 157 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | * @return void |
| 164 | 164 | */ |
| 165 | 165 | public function enqueue_scripts() { |
| 166 | - wp_enqueue_style( $this->plugin_name . '-vendors' ); |
|
| 167 | - wp_enqueue_style( $this->plugin_name . '-admin' ); |
|
| 168 | - wp_enqueue_script( $this->plugin_name . '-admin' ); |
|
| 166 | + wp_enqueue_style($this->plugin_name.'-vendors'); |
|
| 167 | + wp_enqueue_style($this->plugin_name.'-admin'); |
|
| 168 | + wp_enqueue_script($this->plugin_name.'-admin'); |
|
| 169 | 169 | } |
| 170 | 170 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @since 1.0.0 |
| 102 | 102 | * @access public |
| 103 | 103 | */ |
| 104 | - public function __construct( $plugin_name ) { |
|
| 104 | + public function __construct($plugin_name) { |
|
| 105 | 105 | $this->plugin_name = $plugin_name; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @access public |
| 113 | 113 | */ |
| 114 | 114 | public function save() { |
| 115 | - add_action( 'admin_menu', array( $this, 'create_submenu' ) ); |
|
| 115 | + add_action('admin_menu', array($this, 'create_submenu')); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | * @param array $options Pass proprties as an array. |
| 123 | 123 | * @access public |
| 124 | 124 | */ |
| 125 | - public function make( $options = array() ) { |
|
| 126 | - foreach ( $options as $property => $value ) { |
|
| 127 | - if ( property_exists( $this, $property ) ) { |
|
| 125 | + public function make($options = array()) { |
|
| 126 | + foreach ($options as $property => $value) { |
|
| 127 | + if (property_exists($this, $property)) { |
|
| 128 | 128 | $this->{$property} = $value; |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | - add_action( 'admin_menu', array( $this, 'create_submenu' ) ); |
|
| 131 | + add_action('admin_menu', array($this, 'create_submenu')); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @return void |
| 138 | 138 | */ |
| 139 | 139 | public function create_submenu() { |
| 140 | - if ( current_user_can( $this->capability ) ) { |
|
| 140 | + if (current_user_can($this->capability)) { |
|
| 141 | 141 | $hook = add_submenu_page( |
| 142 | 142 | $this->parent_slug, |
| 143 | 143 | $this->page_title, |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - add_action( 'load-' . $hook, array( $this, 'init_hooks' ) ); |
|
| 152 | + add_action('load-'.$hook, array($this, 'init_hooks')); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @return void |
| 159 | 159 | */ |
| 160 | 160 | public function init_hooks() { |
| 161 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
| 161 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | * @return void |
| 168 | 168 | */ |
| 169 | 169 | public function enqueue_scripts() { |
| 170 | - wp_enqueue_style( $this->plugin_name . '-vendors' ); |
|
| 171 | - wp_enqueue_style( $this->plugin_name . '-admin' ); |
|
| 172 | - wp_enqueue_script( $this->plugin_name . '-admin' ); |
|
| 170 | + wp_enqueue_style($this->plugin_name.'-vendors'); |
|
| 171 | + wp_enqueue_style($this->plugin_name.'-admin'); |
|
| 172 | + wp_enqueue_script($this->plugin_name.'-admin'); |
|
| 173 | 173 | } |
| 174 | 174 | } |