-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from joanrodas/dev
Dev
- Loading branch information
Showing
14 changed files
with
2,052 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
<?php | ||
|
||
namespace PluginPlaceholder\Includes; | ||
|
||
class Loader | ||
{ | ||
protected $plugin_name; | ||
protected $plugin_version; | ||
protected $plugin_name; | ||
protected $plugin_version; | ||
|
||
public function __construct() | ||
{ | ||
$this->plugin_version = defined('PLUGIN_PLACEHOLDER_VERSION') ? PLUGIN_PLACEHOLDER_VERSION : '1.0.0'; | ||
$this->plugin_name = 'plugin-placeholder'; | ||
$this->load_dependencies(); | ||
public function __construct() | ||
{ | ||
$this->plugin_version = defined('PLUGIN_PLACEHOLDER_VERSION') ? PLUGIN_PLACEHOLDER_VERSION : '1.0.0'; | ||
$this->plugin_name = 'plugin-placeholder'; | ||
$this->loadDependencies(); | ||
|
||
add_action('plugins_loaded', [$this, 'load_plugin_textdomain']); | ||
} | ||
add_action('plugins_loaded', [$this, 'loadPluginTextdomain']); | ||
} | ||
|
||
private function load_dependencies() | ||
{ | ||
foreach (glob(PLUGIN_PLACEHOLDER_PATH . 'Functionality/*.php') as $filename) { | ||
$class_name = '\\PluginPlaceholder\Functionality\\'. basename($filename, '.php'); | ||
if (class_exists($class_name)) { | ||
try { | ||
new $class_name($this->plugin_name, $this->plugin_version); | ||
} | ||
catch (\Throwable $e) { | ||
pb_log($e); | ||
continue; | ||
} | ||
} | ||
} | ||
} | ||
private function loadDependencies() | ||
{ | ||
foreach (glob(PLUGIN_PLACEHOLDER_PATH . 'Functionality/*.php') as $filename) { | ||
$class_name = '\\PluginPlaceholder\Functionality\\' . basename($filename, '.php'); | ||
if (class_exists($class_name)) { | ||
try { | ||
new $class_name($this->plugin_name, $this->plugin_version); | ||
} catch (\Throwable $e) { | ||
pb_log($e); | ||
continue; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public function load_plugin_textdomain() | ||
{ | ||
load_plugin_textdomain('plugin-placeholder', false, dirname(PLUGIN_PLACEHOLDER_BASENAME) . '/languages/'); | ||
} | ||
public function loadPluginTextdomain() | ||
{ | ||
load_plugin_textdomain('plugin-placeholder', false, dirname(PLUGIN_PLACEHOLDER_BASENAME) . '/languages/'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<?php | ||
|
||
namespace PluginPlaceholder\Includes; | ||
|
||
class Lyfecycle | ||
{ | ||
public static function activate() | ||
{ | ||
do_action('PluginPlaceholder/setup'); | ||
} | ||
|
||
public static function deactivate() | ||
{ | ||
public static function activate() | ||
{ | ||
do_action('PluginPlaceholder/setup'); | ||
} | ||
|
||
public static function deactivate() | ||
{ | ||
} | ||
|
||
} | ||
|
||
public static function uninstall() | ||
{ | ||
do_action('PluginPlaceholder/cleanup'); | ||
} | ||
public static function uninstall() | ||
{ | ||
do_action('PluginPlaceholder/cleanup'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<?php | ||
|
||
global $react_apps; | ||
$react_apps = array(); | ||
$react_apps = []; |
Oops, something went wrong.