-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing the frontend classes and the style includes for that.
- Loading branch information
Showing
3 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
namespace lsx_starter_plugin\classes; | ||
|
||
/** | ||
* LSX Starter Plugin Frontend Class. | ||
* | ||
* @package lsx-starter-plugin | ||
*/ | ||
class Frontend { | ||
/** | ||
* Contructor | ||
*/ | ||
public function __construct() { | ||
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 1 ); | ||
} | ||
|
||
/** | ||
* Register and enqueue admin-specific style sheet. | ||
* | ||
* @return null | ||
*/ | ||
public function enqueue_scripts() { | ||
if ( ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) || ( defined('WP_LOCALSITE') && WP_LOCALSITE ) ) { | ||
$prefix = 'src/'; | ||
$suffix = ''; | ||
} else { | ||
$prefix = ''; | ||
$suffix = '.min'; | ||
} | ||
|
||
wp_enqueue_script( 'lsx-starter-plugin-script', LSX_STARTER_PLUGIN_URL . 'assets/js/' . $prefix . 'lsx-starter-plugin' . $suffix . '.js', array( 'jquery' ), LSX_STARTER_PLUGIN_VER, true ); | ||
wp_enqueue_style( 'lsx-starter-plugin-style', LSX_STARTER_PLUGIN_URL . 'assets/css/lsx-starter-plugin.css', array(), LSX_STARTER_PLUGIN_VER ); | ||
} | ||
} | ||
|
||
return new Frontend(); |