Version Description
- Added prefixes to the stylesheet and script names when using wp_enqueue_style() and wp_enqueue_script().
- Added constant for storing the plugin version number.
Download this release
Release Info
Developer | Arthur Gareginyan |
Plugin | Head and Footer Scripts Inserter |
Version | 3.2 |
Comparing to | |
See all releases |
Code changes from version 3.1 to 3.2
- header-and-footer-scripts-inserter.php +15 -13
- readme.txt +4 -1
header-and-footer-scripts-inserter.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Easily add your scripts to the WordPress website's head and footer sections. This is a must have tool for authors and website's owners.
|
6 |
* Author: Arthur Gareginyan
|
7 |
* Author URI: http://www.arthurgareginyan.com
|
8 |
-
* Version: 3.
|
9 |
* License: GPL3
|
10 |
* Text Domain: header-and-footer-scripts-inserter
|
11 |
* Domain Path: /languages/
|
@@ -29,6 +29,7 @@
|
|
29 |
*
|
30 |
*/
|
31 |
|
|
|
32 |
/**
|
33 |
* Prevent Direct Access
|
34 |
*
|
@@ -37,14 +38,15 @@
|
|
37 |
defined('ABSPATH') or die("Restricted access!");
|
38 |
|
39 |
/**
|
40 |
-
* Define constants
|
41 |
*
|
42 |
-
* @since 2
|
43 |
*/
|
44 |
defined('HFSINS_DIR') or define('HFSINS_DIR', dirname(plugin_basename(__FILE__)));
|
45 |
defined('HFSINS_BASE') or define('HFSINS_BASE', plugin_basename(__FILE__));
|
46 |
defined('HFSINS_URL') or define('HFSINS_URL', plugin_dir_url(__FILE__));
|
47 |
defined('HFSINS_PATH') or define('HFSINS_PATH', plugin_dir_path(__FILE__));
|
|
|
48 |
|
49 |
/**
|
50 |
* Register text domain
|
@@ -93,7 +95,7 @@ require_once( HFSINS_PATH . 'inc/php/settings_page.php' );
|
|
93 |
/**
|
94 |
* Load scripts and style sheet for settings page
|
95 |
*
|
96 |
-
* @since 3.
|
97 |
*/
|
98 |
function HFScriptsIns_load_scripts($hook) {
|
99 |
|
@@ -103,19 +105,19 @@ function HFScriptsIns_load_scripts($hook) {
|
|
103 |
}
|
104 |
|
105 |
// Style sheet
|
106 |
-
wp_enqueue_style( 'admin-css', HFSINS_URL . 'inc/css/admin.css' );
|
107 |
|
108 |
// JavaScript
|
109 |
-
wp_enqueue_script( 'admin-js', HFSINS_URL . 'inc/js/admin.js', array(), false, true );
|
110 |
|
111 |
// CodeMirror
|
112 |
-
wp_enqueue_style( 'codemirror-css', HFSINS_URL . 'inc/lib/codemirror/codemirror.css' );
|
113 |
-
wp_enqueue_script( 'codemirror-js', HFSINS_URL . 'inc/lib/codemirror/codemirror.js' );
|
114 |
-
wp_enqueue_script( 'codemirror-mode-htmlmixed', HFSINS_URL . 'inc/lib/codemirror/mode/htmlmixed.js' );
|
115 |
-
wp_enqueue_script( 'codemirror-mode-javascript', HFSINS_URL . 'inc/lib/codemirror/mode/javascript.js' );
|
116 |
-
wp_enqueue_script( 'codemirror-mode-xml', HFSINS_URL . 'inc/lib/codemirror/mode/xml.js' );
|
117 |
-
wp_enqueue_script( 'codemirror-mode-css', HFSINS_URL . 'inc/lib/codemirror/mode/css.js' );
|
118 |
-
wp_enqueue_script( 'codemirror-mode-active-line', HFSINS_URL . 'inc/lib/codemirror/addons/active-line.js' );
|
119 |
|
120 |
}
|
121 |
add_action('admin_enqueue_scripts', 'HFScriptsIns_load_scripts');
|
5 |
* Description: Easily add your scripts to the WordPress website's head and footer sections. This is a must have tool for authors and website's owners.
|
6 |
* Author: Arthur Gareginyan
|
7 |
* Author URI: http://www.arthurgareginyan.com
|
8 |
+
* Version: 3.2
|
9 |
* License: GPL3
|
10 |
* Text Domain: header-and-footer-scripts-inserter
|
11 |
* Domain Path: /languages/
|
29 |
*
|
30 |
*/
|
31 |
|
32 |
+
|
33 |
/**
|
34 |
* Prevent Direct Access
|
35 |
*
|
38 |
defined('ABSPATH') or die("Restricted access!");
|
39 |
|
40 |
/**
|
41 |
+
* Define global constants
|
42 |
*
|
43 |
+
* @since 3.2
|
44 |
*/
|
45 |
defined('HFSINS_DIR') or define('HFSINS_DIR', dirname(plugin_basename(__FILE__)));
|
46 |
defined('HFSINS_BASE') or define('HFSINS_BASE', plugin_basename(__FILE__));
|
47 |
defined('HFSINS_URL') or define('HFSINS_URL', plugin_dir_url(__FILE__));
|
48 |
defined('HFSINS_PATH') or define('HFSINS_PATH', plugin_dir_path(__FILE__));
|
49 |
+
defined('HFSINS_VERSION') or define('HFSINS_VERSION', '3.2');
|
50 |
|
51 |
/**
|
52 |
* Register text domain
|
95 |
/**
|
96 |
* Load scripts and style sheet for settings page
|
97 |
*
|
98 |
+
* @since 3.2
|
99 |
*/
|
100 |
function HFScriptsIns_load_scripts($hook) {
|
101 |
|
105 |
}
|
106 |
|
107 |
// Style sheet
|
108 |
+
wp_enqueue_style( 'HFScriptsIns-admin-css', HFSINS_URL . 'inc/css/admin.css' );
|
109 |
|
110 |
// JavaScript
|
111 |
+
wp_enqueue_script( 'HFScriptsIns-admin-js', HFSINS_URL . 'inc/js/admin.js', array(), false, true );
|
112 |
|
113 |
// CodeMirror
|
114 |
+
wp_enqueue_style( 'HFScriptsIns-codemirror-css', HFSINS_URL . 'inc/lib/codemirror/codemirror.css' );
|
115 |
+
wp_enqueue_script( 'HFScriptsIns-codemirror-js', HFSINS_URL . 'inc/lib/codemirror/codemirror.js' );
|
116 |
+
wp_enqueue_script( 'HFScriptsIns-codemirror-mode-htmlmixed', HFSINS_URL . 'inc/lib/codemirror/mode/htmlmixed.js' );
|
117 |
+
wp_enqueue_script( 'HFScriptsIns-codemirror-mode-javascript', HFSINS_URL . 'inc/lib/codemirror/mode/javascript.js' );
|
118 |
+
wp_enqueue_script( 'HFScriptsIns-codemirror-mode-xml', HFSINS_URL . 'inc/lib/codemirror/mode/xml.js' );
|
119 |
+
wp_enqueue_script( 'HFScriptsIns-codemirror-mode-css', HFSINS_URL . 'inc/lib/codemirror/mode/css.js' );
|
120 |
+
wp_enqueue_script( 'HFScriptsIns-codemirror-mode-active-line', HFSINS_URL . 'inc/lib/codemirror/addons/active-line.js' );
|
121 |
|
122 |
}
|
123 |
add_action('admin_enqueue_scripts', 'HFScriptsIns_load_scripts');
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: inject, insert, insert scripts, insert javascript, insert js, insert html,
|
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.6
|
7 |
-
Stable tag: 3.
|
8 |
License: GPL3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -127,6 +127,9 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
|
|
127 |
* [Dedicated Plugin Page on GitHub](https://github.com/ArthurGareginyan/header-and-footer-scripts-inserter)
|
128 |
|
129 |
== Changelog ==
|
|
|
|
|
|
|
130 |
= 3.1 =
|
131 |
* Style sheet of settings page improved and better commented.
|
132 |
* The "main.js" file renamed to "admin.js".
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.6
|
7 |
+
Stable tag: 3.2
|
8 |
License: GPL3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
127 |
* [Dedicated Plugin Page on GitHub](https://github.com/ArthurGareginyan/header-and-footer-scripts-inserter)
|
128 |
|
129 |
== Changelog ==
|
130 |
+
= 3.2 =
|
131 |
+
* Added prefixes to the stylesheet and script names when using wp_enqueue_style() and wp_enqueue_script().
|
132 |
+
* Added constant for storing the plugin version number.
|
133 |
= 3.1 =
|
134 |
* Style sheet of settings page improved and better commented.
|
135 |
* The "main.js" file renamed to "admin.js".
|