|
4 | 4 | * |
5 | 5 | * @author Seth Carstens |
6 | 6 | * @package abtract-plugin-base |
7 | | - * @version 2.5.1 |
| 7 | + * @version 2.5.3 |
8 | 8 | * @license GPL 2.0 - please retain comments that express original build of this file by the author. |
9 | 9 | */ |
10 | 10 |
|
@@ -177,10 +177,10 @@ public function __construct() { |
177 | 177 | $this->onload( $this ); |
178 | 178 |
|
179 | 179 | // Most actions go into init which loads after WordPress core sets up all the defaults. |
180 | | - add_action( 'App', array( $this, 'App' ) ); |
| 180 | + add_action( 'init', array( $this, 'init' ) ); |
181 | 181 |
|
182 | 182 | // Init for use with logged in users, see this::authenticated_init for more details. |
183 | | - add_action( 'App', array( $this, 'authenticated_init' ) ); |
| 183 | + add_action( 'init', array( $this, 'authenticated_init' ) ); |
184 | 184 |
|
185 | 185 | // Hook can be used by mu plugins to modify plugin behavior after plugin is setup. |
186 | 186 | do_action( get_called_class() . '_setup', $this ); |
@@ -236,13 +236,13 @@ public function autoload( $class ) { |
236 | 236 | * Setup plugins global params. |
237 | 237 | */ |
238 | 238 | protected function configure_defaults() { |
239 | | - $this->modules = new \stdClass(); |
240 | | - $this->modules->count = 0; |
241 | | - $this->installed_dir = static::dirname( static::$current_file, 1 ); |
242 | | - $this->plugin_basedir = static::dirname( static::$current_file, 2 ); |
243 | | - $assumed_plugin_name = basename( $this->plugin_basedir ); |
244 | | - $this->plugin_file = $this->plugin_basedir . '/' . $assumed_plugin_name . '.php'; |
245 | | - $this->wp_plugin_slug = $assumed_plugin_name . '/' . $assumed_plugin_name . '.php'; |
| 239 | + $this->modules = new \stdClass(); |
| 240 | + $this->modules->count = 0; |
| 241 | + $this->installed_dir = static::dirname( static::$current_file, 1 ); |
| 242 | + $this->plugin_basedir = static::dirname( static::$current_file, 2 ); |
| 243 | + $assumed_plugin_name = basename( $this->plugin_basedir ); |
| 244 | + $this->plugin_file = $this->plugin_basedir . '/' . $assumed_plugin_name . '.php'; |
| 245 | + $this->wp_plugin_slug = $assumed_plugin_name . '/' . $assumed_plugin_name . '.php'; |
246 | 246 |
|
247 | 247 | if ( is_callable( 'is_plugin_active_for_network' ) ) { |
248 | 248 | $this->is_network_active = is_plugin_active_for_network( $this->wp_plugin_slug ); |
@@ -291,11 +291,11 @@ abstract protected function defines_and_globals(); |
291 | 291 | * |
292 | 292 | * @return string |
293 | 293 | */ |
294 | | - public static function dirname($path, $count=1){ |
295 | | - if ($count > 1){ |
296 | | - return dirname(static::dirname($path, --$count)); |
297 | | - }else{ |
298 | | - return dirname($path); |
| 294 | + public static function dirname( $path, $count = 1 ) { |
| 295 | + if ( $count > 1 ) { |
| 296 | + return dirname( static::dirname( $path, -- $count ) ); |
| 297 | + } else { |
| 298 | + return dirname( $path ); |
299 | 299 | } |
300 | 300 | } |
301 | 301 |
|
@@ -430,7 +430,7 @@ private function psr4_get_file_name_from_class( $class ) { |
430 | 430 | public static function run( $file ) { |
431 | 431 | // Logic required for WordPress VIP plugins to load during themes function file initialization. |
432 | 432 | if ( did_action( 'plugins_loaded' ) ) { |
433 | | - add_action( 'App', array( get_called_class(), 'load' ), 1 ); |
| 433 | + add_action( 'init', array( get_called_class(), 'load' ), 1 ); |
434 | 434 | } else { |
435 | 435 | add_action( 'plugins_loaded', array( get_called_class(), 'load' ) ); |
436 | 436 | // Installation and un-installation hooks. |
|
0 commit comments