My Custom Functions - Version 4.23

Version Description

  • The code block that enqueue the CodeMirror library files is moved to a separate function '_load_scripts_codemirror' within the 'enqueue.php' file.
  • Enqueue of the CodeMirror addons is moved to the beginning of the queue, before enqueuing the CodeMirror mods.
  • All translation files are updated.
Download this release

Release Info

Developer Arthur Gareginyan
Plugin Icon 128x128 My Custom Functions
Version 4.23
Comparing to
See all releases

Code changes from version 4.22 to 4.23

inc/php/enqueue.php CHANGED
@@ -5,6 +5,49 @@
5
  */
6
  defined( 'ABSPATH' ) or die( "Restricted access!" );
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  /**
9
  * Load scripts and style sheet for settings page
10
  */
@@ -31,23 +74,8 @@ function spacexchimp_p001_load_scripts_admin( $hook ) {
31
  // Font Awesome library
32
  wp_enqueue_style( $prefix . '-font-awesome-css', $url . 'inc/lib/font-awesome/css/font-awesome.css', array(), $version, 'screen' );
33
 
34
- // CodeMirror library
35
- wp_enqueue_style( $prefix . '-codemirror-css', $url . 'inc/lib/codemirror/lib/codemirror.css', array(), $version, 'all' );
36
- wp_enqueue_script( $prefix . '-codemirror-js', $url . 'inc/lib/codemirror/lib/codemirror.js', array(), $version, false );
37
- wp_enqueue_script( $prefix . '-codemirror-settings-js', $url . 'inc/js/codemirror-settings.js', array(), $version, true );
38
- $modes = array( 'clike', 'css', 'htmlmixed', 'javascript', 'php', 'xml' );
39
- foreach ( $modes as $mode ) {
40
- wp_enqueue_script( $prefix . '-codemirror-mode-' . $mode . '-js', $url . 'inc/lib/codemirror/mode/' . $mode . '/' . $mode . '.js', array(), $version, true );
41
- }
42
- $addons = array(
43
- 'display' => array( 'autorefresh', 'placeholder' ),
44
- 'selection' => array( 'active-line' )
45
- );
46
- foreach ( $addons as $addons_group_name => $addons_group ) {
47
- foreach ( $addons_group as $addon ) {
48
- wp_enqueue_script( $prefix . '-codemirror-addon-' . $addon . '-js', $url . 'inc/lib/codemirror/addon/' . $addons_group_name . '/' . $addon . '.js', array(), $version, false );
49
- }
50
- }
51
 
52
  // Other libraries
53
  wp_enqueue_script( $prefix . '-bootstrap-checkbox-js', $url . 'inc/lib/bootstrap-checkbox.js', array(), $version, false );
5
  */
6
  defined( 'ABSPATH' ) or die( "Restricted access!" );
7
 
8
+ /**
9
+ * Callback to enqueue the CodeMirror library
10
+ */
11
+ function spacexchimp_p001_load_scripts_codemirror() {
12
+
13
+ // Put value of constants to variables for easier access
14
+ $prefix = SPACEXCHIMP_P001_PREFIX;
15
+ $url = SPACEXCHIMP_P001_URL;
16
+ $version = SPACEXCHIMP_P001_VERSION;
17
+
18
+ // Enqueue main files of the CodeMirror library
19
+ wp_enqueue_style( $prefix . '-codemirror-css', $url . 'inc/lib/codemirror/lib/codemirror.css', array(), $version, 'all' );
20
+ wp_enqueue_script( $prefix . '-codemirror-js', $url . 'inc/lib/codemirror/lib/codemirror.js', array(), $version, false );
21
+
22
+ // Enqueue settings file
23
+ wp_enqueue_script( $prefix . '-codemirror-settings-js', $url . 'inc/js/codemirror-settings.js', array(), $version, true );
24
+
25
+ // Enqueue addons
26
+ $addons = array(
27
+ 'display' => array( 'autorefresh', 'placeholder' ),
28
+ 'selection' => array( 'active-line' )
29
+ );
30
+ foreach ( $addons as $addons_group_name => $addons_group ) {
31
+ foreach ( $addons_group as $addon ) {
32
+ wp_enqueue_script( $prefix . '-codemirror-addon-' . $addon . '-js', $url . 'inc/lib/codemirror/addon/' . $addons_group_name . '/' . $addon . '.js', array(), $version, false );
33
+ }
34
+ }
35
+
36
+ // Enqueue modes
37
+ $modes = array(
38
+ 'clike',
39
+ 'css',
40
+ 'htmlmixed',
41
+ 'javascript',
42
+ 'php',
43
+ 'xml'
44
+ );
45
+ foreach ( $modes as $mode ) {
46
+ wp_enqueue_script( $prefix . '-codemirror-mode-' . $mode . '-js', $url . 'inc/lib/codemirror/mode/' . $mode . '/' . $mode . '.js', array(), $version, true );
47
+ }
48
+
49
+ }
50
+
51
  /**
52
  * Load scripts and style sheet for settings page
53
  */
74
  // Font Awesome library
75
  wp_enqueue_style( $prefix . '-font-awesome-css', $url . 'inc/lib/font-awesome/css/font-awesome.css', array(), $version, 'screen' );
76
 
77
+ // Call the function that enqueue the CodeMirror library
78
+ spacexchimp_p001_load_scripts_codemirror();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  // Other libraries
81
  wp_enqueue_script( $prefix . '-bootstrap-checkbox-js', $url . 'inc/lib/bootstrap-checkbox.js', array(), $version, false );
languages/my-custom-functions-de_DE.mo CHANGED
Binary file
languages/my-custom-functions-de_DE.po CHANGED
@@ -3,8 +3,8 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
- "POT-Creation-Date: 2018-06-30 20:01+0300\n"
7
- "PO-Revision-Date: 2018-06-30 20:01+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: German\n"
10
  "Language: de_DE\n"
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
+ "POT-Creation-Date: 2018-07-12 01:18+0300\n"
7
+ "PO-Revision-Date: 2018-07-12 01:18+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: German\n"
10
  "Language: de_DE\n"
languages/my-custom-functions-es_ES.mo CHANGED
Binary file
languages/my-custom-functions-es_ES.po CHANGED
@@ -3,8 +3,8 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
- "POT-Creation-Date: 2018-06-30 20:01+0300\n"
7
- "PO-Revision-Date: 2018-06-30 20:01+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: Spanish\n"
10
  "Language: es_ES\n"
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
+ "POT-Creation-Date: 2018-07-12 01:18+0300\n"
7
+ "PO-Revision-Date: 2018-07-12 01:18+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: Spanish\n"
10
  "Language: es_ES\n"
languages/my-custom-functions-fr_FR.mo CHANGED
Binary file
languages/my-custom-functions-fr_FR.po CHANGED
@@ -3,8 +3,8 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
- "POT-Creation-Date: 2018-06-30 20:01+0300\n"
7
- "PO-Revision-Date: 2018-06-30 20:01+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: French\n"
10
  "Language: fr_FR\n"
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
+ "POT-Creation-Date: 2018-07-12 01:18+0300\n"
7
+ "PO-Revision-Date: 2018-07-12 01:18+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: French\n"
10
  "Language: fr_FR\n"
languages/my-custom-functions-ru_RU.mo CHANGED
Binary file
languages/my-custom-functions-ru_RU.po CHANGED
@@ -3,8 +3,8 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
- "POT-Creation-Date: 2018-06-30 20:01+0300\n"
7
- "PO-Revision-Date: 2018-06-30 20:01+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: Russian\n"
10
  "Language: ru_RU\n"
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
+ "POT-Creation-Date: 2018-07-12 01:18+0300\n"
7
+ "PO-Revision-Date: 2018-07-12 01:18+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: Russian\n"
10
  "Language: ru_RU\n"
languages/my-custom-functions-zh_TW.mo CHANGED
Binary file
languages/my-custom-functions-zh_TW.po CHANGED
@@ -3,8 +3,8 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
- "POT-Creation-Date: 2018-06-30 20:01+0300\n"
7
- "PO-Revision-Date: 2018-06-30 20:01+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: Chinese (Taiwan)\n"
10
  "Language: zh_TW\n"
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: My Custom Functions\n"
6
+ "POT-Creation-Date: 2018-07-12 01:18+0300\n"
7
+ "PO-Revision-Date: 2018-07-12 01:18+0300\n"
8
  "Last-Translator: Arthur Gareginyan\n"
9
  "Language-Team: Chinese (Taiwan)\n"
10
  "Language: zh_TW\n"
languages/my-custom-functions.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: My Custom Functions\n"
6
- "POT-Creation-Date: 2018-06-30 20:01+0300\n"
7
  "PO-Revision-Date: 2015-08-30 16:22+0300\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: My Custom Functions\n"
6
+ "POT-Creation-Date: 2018-07-12 01:18+0300\n"
7
  "PO-Revision-Date: 2015-08-30 16:22+0300\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
my-custom-functions.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Easily and safely add your custom functions (PHP code) directly out of your WordPress Admin Area, without the need to have an external editor.
6
  * Author: Space X-Chimp
7
  * Author URI: https://www.spacexchimp.com
8
- * Version: 4.22
9
  * License: GPL3
10
  * Text Domain: my-custom-functions
11
  * Domain Path: /languages/
5
  * Description: Easily and safely add your custom functions (PHP code) directly out of your WordPress Admin Area, without the need to have an external editor.
6
  * Author: Space X-Chimp
7
  * Author URI: https://www.spacexchimp.com
8
+ * Version: 4.23
9
  * License: GPL3
10
  * Text Domain: my-custom-functions
11
  * Domain Path: /languages/
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: code, php, function, snippet, custom, execute, edit, editing, editor, func
4
  Donate link: https://www.spacexchimp.com/donate.html
5
  Requires at least: 3.9
6
  Tested up to: 4.9
7
- Stable tag: 4.22
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -215,6 +215,11 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
215
 
216
  == Changelog ==
217
 
 
 
 
 
 
218
  = 4.22 =
219
  * Fixed: CodeMirror addon 'autorefresh.js' was added to one of the previous versions of the plugin, but it was not enabled.
220
 
4
  Donate link: https://www.spacexchimp.com/donate.html
5
  Requires at least: 3.9
6
  Tested up to: 4.9
7
+ Stable tag: 4.23
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
215
 
216
  == Changelog ==
217
 
218
+ = 4.23 =
219
+ * The code block that enqueue the CodeMirror library files is moved to a separate function '_load_scripts_codemirror' within the 'enqueue.php' file.
220
+ * Enqueue of the CodeMirror addons is moved to the beginning of the queue, before enqueuing the CodeMirror mods.
221
+ * All translation files are updated.
222
+
223
  = 4.22 =
224
  * Fixed: CodeMirror addon 'autorefresh.js' was added to one of the previous versions of the plugin, but it was not enabled.
225