My Custom Functions - Version 3.1

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 Icon 128x128 My Custom Functions
Version 3.1
Comparing to
See all releases

Code changes from version 3.0 to 3.1

Files changed (2) hide show
  1. my-custom-functions.php +10 -8
  2. readme.txt +4 -1
my-custom-functions.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Easily and safely add your custome functions (PHP code) directly out of your WordPress Dashboard without need of an external editor.
6
  * Author: Arthur Gareginyan
7
  * Author URI: http://www.arthurgareginyan.com
8
- * Version: 3.0
9
  * License: GPL3
10
  * Text Domain: my-custom-functions
11
  * Domain Path: /languages/
@@ -29,6 +29,7 @@
29
  *
30
  */
31
 
 
32
  /**
33
  * Prevent Direct Access
34
  *
@@ -39,12 +40,13 @@ defined('ABSPATH') or die("Restricted access!");
39
  /**
40
  * Define constants
41
  *
42
- * @since 2.0
43
  */
44
  defined('MCFUNC_DIR') or define('MCFUNC_DIR', dirname(plugin_basename(__FILE__)));
45
  defined('MCFUNC_BASE') or define('MCFUNC_BASE', plugin_basename(__FILE__));
46
  defined('MCFUNC_URL') or define('MCFUNC_URL', plugin_dir_url(__FILE__));
47
  defined('MCFUNC_PATH') or define('MCFUNC_PATH', plugin_dir_path(__FILE__));
 
48
 
49
  /**
50
  * Register text domain
@@ -104,7 +106,7 @@ add_action( 'admin_init', 'MCFunctions_register_settings' );
104
  /**
105
  * Load scripts and style sheet for settings page
106
  *
107
- * @since 3.0
108
  */
109
  function MCFunctions_load_scripts($hook) {
110
 
@@ -114,15 +116,15 @@ function MCFunctions_load_scripts($hook) {
114
  }
115
 
116
  // Style sheet
117
- wp_enqueue_style( 'admin-css', MCFUNC_URL . 'inc/css/admin.css' );
118
 
119
  // JavaScript
120
- wp_enqueue_script( 'admin-js', MCFUNC_URL . 'inc/js/admin.js', array(), false, true );
121
 
122
  // CodeMirror
123
- wp_enqueue_style( 'codemirror-css', MCFUNC_URL . 'inc/lib/codemirror/codemirror.css' );
124
- wp_enqueue_script( 'codemirror-js', MCFUNC_URL . 'inc/lib/codemirror/codemirror-compressed.js' );
125
- wp_enqueue_script( 'codemirror-active-line', MCFUNC_URL . 'inc/lib/codemirror/addons/active-line.js' );
126
 
127
  }
128
  add_action( 'admin_enqueue_scripts', 'MCFunctions_load_scripts' );
5
  * Description: Easily and safely add your custome functions (PHP code) directly out of your WordPress Dashboard without need of an external editor.
6
  * Author: Arthur Gareginyan
7
  * Author URI: http://www.arthurgareginyan.com
8
+ * Version: 3.1
9
  * License: GPL3
10
  * Text Domain: my-custom-functions
11
  * Domain Path: /languages/
29
  *
30
  */
31
 
32
+
33
  /**
34
  * Prevent Direct Access
35
  *
40
  /**
41
  * Define constants
42
  *
43
+ * @since 3.1
44
  */
45
  defined('MCFUNC_DIR') or define('MCFUNC_DIR', dirname(plugin_basename(__FILE__)));
46
  defined('MCFUNC_BASE') or define('MCFUNC_BASE', plugin_basename(__FILE__));
47
  defined('MCFUNC_URL') or define('MCFUNC_URL', plugin_dir_url(__FILE__));
48
  defined('MCFUNC_PATH') or define('MCFUNC_PATH', plugin_dir_path(__FILE__));
49
+ defined('MCFUNC_VERSION') or define('MCFUNC_VERSION', '3.1');
50
 
51
  /**
52
  * Register text domain
106
  /**
107
  * Load scripts and style sheet for settings page
108
  *
109
+ * @since 3.1
110
  */
111
  function MCFunctions_load_scripts($hook) {
112
 
116
  }
117
 
118
  // Style sheet
119
+ wp_enqueue_style( 'MCFunctions-admin-css', MCFUNC_URL . 'inc/css/admin.css' );
120
 
121
  // JavaScript
122
+ wp_enqueue_script( 'MCFunctions-admin-js', MCFUNC_URL . 'inc/js/admin.js', array(), false, true );
123
 
124
  // CodeMirror
125
+ wp_enqueue_style( 'MCFunctions-codemirror-css', MCFUNC_URL . 'inc/lib/codemirror/codemirror.css' );
126
+ wp_enqueue_script( 'MCFunctions-codemirror-js', MCFUNC_URL . 'inc/lib/codemirror/codemirror-compressed.js' );
127
+ wp_enqueue_script( 'MCFunctions-codemirror-active-line', MCFUNC_URL . 'inc/lib/codemirror/addons/active-line.js' );
128
 
129
  }
130
  add_action( 'admin_enqueue_scripts', 'MCFunctions_load_scripts' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: code, php, function, snippet, custom, execute, edit, editing, editor, func
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.0
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -144,6 +144,9 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
144
 
145
 
146
  == Changelog ==
 
 
 
147
  = 3.0 =
148
  * The structure of files changed.
149
  * Style sheet of settings page improved and better commented.
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.1
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
144
 
145
 
146
  == Changelog ==
147
+ = 3.1 =
148
+ * Added prefixes to the stylesheet and script names when using wp_enqueue_style() and wp_enqueue_script().
149
+ * Added constant for storing the plugin version number.
150
  = 3.0 =
151
  * The structure of files changed.
152
  * Style sheet of settings page improved and better commented.