Skip to content

Commit

Permalink
Fixed Assests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakiboy committed May 18, 2020
1 parent beca935 commit a523fe7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jakiboy/vanilleplugin",
"version" : "0.0.8",
"version" : "0.0.9",
"type": "library",
"description": "Framwork for VanillePlugin",
"keywords": ["VanillePlugin","WordPress","WordPress-Plugin","WordPress-Plugin-Framework","jakiboy"],
Expand Down
25 changes: 20 additions & 5 deletions src/lib/PluginOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function addPluginSubMenuPage($callable, $slug, $title = '', $parent =
* @param {inherit}
* @return {inherit}
*/
protected function addPluginJS($path, $deps = [], $version = false, $footer = false)
protected function addPluginJS($path, $deps = [], $version = false, $footer = true)
{
$id = str_replace('.js', '', basename($path));
$id = str_replace('.min', '', $id);
Expand All @@ -192,7 +192,7 @@ protected function addPluginJS($path, $deps = [], $version = false, $footer = fa
* @param {inherit}
* @return {inherit}
*/
protected function addPluginMainJS($path, $deps = [], $version = false, $footer = false)
protected function addPluginMainJS($path, $deps = [], $version = false, $footer = true)
{
$path = "{$this->getAsset()}{$path}";
$this->addJS("{$this->getNameSpace()}-main",$path,$deps,$version,$footer);
Expand All @@ -206,7 +206,7 @@ protected function addPluginMainJS($path, $deps = [], $version = false, $footer
* @param {inherit}
* @return {inherit}
*/
protected function addPluginGlobalJS($path, $deps = [], $version = false, $footer = false)
protected function addPluginGlobalJS($path, $deps = [], $version = false, $footer = true)
{
$path = "{$this->getAsset()}{$path}";
$this->addJS("{$this->getNameSpace()}-global",$path,$deps,$version,$footer);
Expand Down Expand Up @@ -235,7 +235,22 @@ protected function localizePluginJS($content = [], $id = 'main')
* @param string $name
* @return {inherit}
*/
protected function addPluginCSS($path, $deps = [], $version = '', $media = 'all')
protected function localizeGlobalJS($content = [], $id = 'global')
{
$prefix = str_replace('-', '', $this->getNameSpace());
$object = "{$prefix}Global";
$this->localizeJS("{$this->getNameSpace()}-{$id}",$object,$content);
}

/**
* Update the value of an option that was already added
*
* @since 4.0.0
* @access protected
* @param string $name
* @return {inherit}
*/
protected function addPluginCSS($path, $deps = [], $version = false, $media = 'all')
{
$id = str_replace('.css', '', basename($path));
$id = str_replace('.min', '', $id);
Expand All @@ -251,7 +266,7 @@ protected function addPluginCSS($path, $deps = [], $version = '', $media = 'all'
* @param string $name
* @return {inherit}
*/
protected function addPluginMainCSS($path, $deps = [], $version = '', $media = 'all')
protected function addPluginMainCSS($path, $deps = [], $version = false, $media = 'all')
{
$path = "{$this->getAsset()}{$path}";
$this->addCSS("{$this->getNameSpace()}-main",$path,$deps,$version,$media);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ protected function addCSS($id, $path, $deps = [], $version = false, $media = 'al
* @param string $footer
* @return void
*/
protected function addJS($id, $path, $deps = [], $version = false, $footer = true)
protected function addJS($id, $path, $deps = [], $version = false, $footer = false)
{
if ( strpos($path, 'http') == false ){
$path = $this->getPluginUrl($path);
Expand Down

0 comments on commit a523fe7

Please sign in to comment.