Skip to content

Commit

Permalink
Fix login page Assets
Browse files Browse the repository at this point in the history
  • Loading branch information
petrozavodsky committed Apr 15, 2019
1 parent 328a7c5 commit bebc4c9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions WordpressMagicBoilerplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Text Domain: WordpressMagicBoilerplate
Domain Path: /languages
Requires PHP: 7.0
Version: 1.0.2
Version: 1.0.3
License: GPLv3
*/

Expand All @@ -28,7 +28,7 @@
use WordpressMagicBoilerplate\Base\Wrap;

class WordpressMagicBoilerplate extends Wrap {
public $version = '1.0.2';
public $version = '1.0.3';
public static $textdomine;

public function __construct() {
Expand Down
4 changes: 2 additions & 2 deletions core/WordpressMagicBoilerplate/Base/Wrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

class Wrap {

public $version = '1.0.2';
public $version = '1.0.3';
public $css_patch = "public/css/";
public $js_patch = "public/js/";

private $defaults_vars = [
'css_patch' => "public/css/",
'js_patch' => "public/js/",
'version' => "1.0.2",
'version' => "1.0.3",
'min' => true
];

Expand Down
2 changes: 1 addition & 1 deletion core/WordpressMagicBoilerplate/Utils/ActivateWidgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ActivateWidgets {

use Assets;

private $version = '1.0.2';
private $version = '1.0.3';
private $space = false;
private $file;
private $css_patch = "public/css/";
Expand Down
7 changes: 6 additions & 1 deletion core/WordpressMagicBoilerplate/Utils/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait Assets {
private $defaults_vars = [
'css_patch' => "public/css/",
'js_patch' => "public/js/",
'version' => "1.0.2",
'version' => "1.0.3",
'min' => true
];

Expand Down Expand Up @@ -113,6 +113,10 @@ public function registerJs( $handle, $in_footer = false, $dep = [], $version = f
$hook = "admin_enqueue_scripts";
}

if($this->loginPage){
$hook = 'login_enqueue_scripts';
}

add_action( $hook, function () use ( $in_footer, $version, $dep, $src, $file_id ) {
wp_enqueue_script(
$file_id,
Expand Down Expand Up @@ -146,6 +150,7 @@ public function addJs( $handle, $position = "wp_enqueue_scripts", $dep = [], $ve
$position = 'admin_enqueue_scripts';
} elseif ($position == 'login' || $position == 'login-page'){
$position = 'login_enqueue_scripts';
$this->loginPage = true;
}

$handle = $this->registerJs( $handle, $position, $dep, $version, $src );
Expand Down
2 changes: 1 addition & 1 deletion src/WordpressMagicBoilerplate/Classes/MyClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function router() {
"Single-script",
"footer",
[ "jquery" ],
"1.0.2"
"1.0.3"
);
}
}
Expand Down

0 comments on commit bebc4c9

Please sign in to comment.