Skip to content

Commit 5dddd3e

Browse files
authored
Merge pull request #1 from WordPress-Phoenix/update-apb
Update abstract-plugin.php
2 parents 3ad0446 + a891a9b commit 5dddd3e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

vendor/wordpress-phoenix/abstract-plugin-base/src/abstract-plugin.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @author Seth Carstens
66
* @package abtract-plugin-base
7-
* @version 2.5.1
7+
* @version 2.5.3
88
* @license GPL 2.0 - please retain comments that express original build of this file by the author.
99
*/
1010

@@ -177,10 +177,10 @@ public function __construct() {
177177
$this->onload( $this );
178178

179179
// 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' ) );
181181

182182
// 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' ) );
184184

185185
// Hook can be used by mu plugins to modify plugin behavior after plugin is setup.
186186
do_action( get_called_class() . '_setup', $this );
@@ -236,13 +236,13 @@ public function autoload( $class ) {
236236
* Setup plugins global params.
237237
*/
238238
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';
246246

247247
if ( is_callable( 'is_plugin_active_for_network' ) ) {
248248
$this->is_network_active = is_plugin_active_for_network( $this->wp_plugin_slug );
@@ -291,11 +291,11 @@ abstract protected function defines_and_globals();
291291
*
292292
* @return string
293293
*/
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 );
299299
}
300300
}
301301

@@ -430,7 +430,7 @@ private function psr4_get_file_name_from_class( $class ) {
430430
public static function run( $file ) {
431431
// Logic required for WordPress VIP plugins to load during themes function file initialization.
432432
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 );
434434
} else {
435435
add_action( 'plugins_loaded', array( get_called_class(), 'load' ) );
436436
// Installation and un-installation hooks.

0 commit comments

Comments
 (0)