My Custom Functions - Version 4.17

Version Description

  • Added new constant "_FILE".
  • Added a function that runs during the plugin activation. Now the date of the first activation of the plugin is recorded in the database.
Download this release

Release Info

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

Code changes from version 4.16 to 4.17

Files changed (3) hide show
  1. inc/php/core.php +21 -0
  2. my-custom-functions.php +2 -1
  3. readme.txt +5 -1
inc/php/core.php CHANGED
@@ -99,3 +99,24 @@ function spacexchimp_p001_admin_footer_text() {
99
  add_filter( 'admin_footer_text', 'spacexchimp_p001_new_admin_footer_text', 11 );
100
  }
101
  add_action( 'current_screen', 'spacexchimp_p001_admin_footer_text' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  add_filter( 'admin_footer_text', 'spacexchimp_p001_new_admin_footer_text', 11 );
100
  }
101
  add_action( 'current_screen', 'spacexchimp_p001_admin_footer_text' );
102
+
103
+ /**
104
+ * Runs during the plugin activation
105
+ */
106
+ function spacexchimp_p001_activation() {
107
+
108
+ // Read the plugin service information from the database and put it into an array
109
+ $info = get_option( SPACEXCHIMP_P001_SETTINGS . '_service_info' );
110
+
111
+ // Make the "$info" array if the plugin service information in the database is not exist
112
+ if ( ! is_array( $info ) ) $info = array();
113
+
114
+ // Get the activation date of the plugin from the database
115
+ $activation_date = !empty( $info['activation_date'] ) ? $info['activation_date'] : '';
116
+
117
+ if ( $activation_date == '' ) {
118
+ $info['activation_date'] = time();
119
+ update_option( SPACEXCHIMP_P001_SETTINGS . '_service_info', $info );
120
+ }
121
+ }
122
+ register_activation_hook( SPACEXCHIMP_P001_FILE, 'spacexchimp_p001_activation' );
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.16
9
  * License: GPL3
10
  * Text Domain: my-custom-functions
11
  * Domain Path: /languages/
@@ -55,6 +55,7 @@ function spacexchimp_p001_define_constants( $constant_name, $value ) {
55
  if ( !defined( $constant_name ) )
56
  define( $constant_name, $value );
57
  }
 
58
  spacexchimp_p001_define_constants( 'DIR', dirname( plugin_basename( __FILE__ ) ) );
59
  spacexchimp_p001_define_constants( 'BASE', plugin_basename( __FILE__ ) );
60
  spacexchimp_p001_define_constants( 'URL', plugin_dir_url( __FILE__ ) );
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.17
9
  * License: GPL3
10
  * Text Domain: my-custom-functions
11
  * Domain Path: /languages/
55
  if ( !defined( $constant_name ) )
56
  define( $constant_name, $value );
57
  }
58
+ spacexchimp_p001_define_constants( 'FILE', __FILE__ );
59
  spacexchimp_p001_define_constants( 'DIR', dirname( plugin_basename( __FILE__ ) ) );
60
  spacexchimp_p001_define_constants( 'BASE', plugin_basename( __FILE__ ) );
61
  spacexchimp_p001_define_constants( 'URL', plugin_dir_url( __FILE__ ) );
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.16
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -210,6 +210,10 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
210
 
211
  == Changelog ==
212
 
 
 
 
 
213
  = 4.16 =
214
  * Added auto-versioning of the CSS and JavaScript files to avoid cache issues.
215
  * CSS code in the file 'admin.css' is optimized.
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.17
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
210
 
211
  == Changelog ==
212
 
213
+ = 4.17 =
214
+ * Added new constant "_FILE".
215
+ * Added a function that runs during the plugin activation. Now the date of the first activation of the plugin is recorded in the database.
216
+
217
  = 4.16 =
218
  * Added auto-versioning of the CSS and JavaScript files to avoid cache issues.
219
  * CSS code in the file 'admin.css' is optimized.