-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack-wordpress-starter.php
53 lines (47 loc) · 1.65 KB
/
webpack-wordpress-starter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* WordPress Webpack Starter
*
* Add here your plugin description and change al the fields.
*
* @link https://marioyepes.com
* @since 1.0.0
* @package Wordpress_Webpack_Starter
*
* @wordpress-plugin
* Plugin Name: wordpress-webpack-starter
* Plugin URI: https://marioyepes.com
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
* Version: 1.0.0
* Author: Mario Yepes
* Author URI: https://marioyepes.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: wordpress-plugin-starter
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Rename this, and start at version 1.0.0
*
* @link https://semver.org
*/
define( 'WORDPRESS_WEBPACK_STARTER_VERSION', '1.0.0' );
/**
* Enqueue the JavaScripts in the Frontend.
*/
function webpack_enqueue_scripts() {
wp_enqueue_script( 'webpack-script-frontend', plugins_url( 'js/frontend.js', __FILE__ ), array(), WORDPRESS_WEBPACK_STARTER_VERSION );
wp_enqueue_style( 'webpack-style-frontend', plugins_url( 'css/frontend.min.css', __FILE__ ), WORDPRESS_WEBPACK_STARTER_VERSION );
}
add_action( 'wp_enqueue_scripts', 'webpack_enqueue_scripts' );
/**
* Enqueue scritps in the Dashboard.
*/
function admin_webpack_enqueue_scripts() {
wp_enqueue_script( 'webpack-script-admin', plugins_url( 'js/admin.js', __FILE__ ), array(), WORDPRESS_WEBPACK_STARTER_VERSION );
}
add_action( 'admin_enqueue_scripts', 'admin_webpack_enqueue_scripts' );