My Custom Functions - Version 4.9

Version Description

  • Fixed the issue due tof which the 'Space X-Chimp' sub menu item in the brand menu item was displayed.
  • Added branded footer text on the plugin's settings page.
Download this release

Release Info

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

Code changes from version 4.8 to 4.9

Files changed (3) hide show
  1. inc/php/core.php +35 -0
  2. my-custom-functions.php +1 -1
  3. readme.txt +6 -2
inc/php/core.php CHANGED
@@ -90,6 +90,20 @@ function spacexchimp_p001_register_submenu_page() {
90
  }
91
  add_action( 'admin_menu', 'spacexchimp_p001_register_submenu_page' );
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  /**
94
  * Register settings
95
  */
@@ -99,3 +113,24 @@ function spacexchimp_p001_register_settings() {
99
  register_setting( SPACEXCHIMP_P001_SETTINGS . '_settings_group', SPACEXCHIMP_P001_SETTINGS . '_error' );
100
  }
101
  add_action( 'admin_init', 'spacexchimp_p001_register_settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  add_action( 'admin_menu', 'spacexchimp_p001_register_submenu_page' );
92
 
93
+ /**
94
+ * Remove the 'Space X-Chimp' sub menu item in the brand menu item
95
+ */
96
+ function spacexchimp_p001_remove_submenu_item() {
97
+
98
+ // Read global variable
99
+ global $submenu;
100
+
101
+ if ( isset( $submenu['spacexchimp'] ) ) {
102
+ unset( $submenu['spacexchimp'][0] );
103
+ }
104
+ }
105
+ add_action( 'admin_menu', 'spacexchimp_p001_remove_submenu_item' );
106
+
107
  /**
108
  * Register settings
109
  */
113
  register_setting( SPACEXCHIMP_P001_SETTINGS . '_settings_group', SPACEXCHIMP_P001_SETTINGS . '_error' );
114
  }
115
  add_action( 'admin_init', 'spacexchimp_p001_register_settings' );
116
+
117
+ /**
118
+ * Branded footer text on the plugin's settings page
119
+ */
120
+ function spacexchimp_p001_admin_footer_text() {
121
+
122
+ // Get current screen data
123
+ $current_screen = get_current_screen();
124
+
125
+ // Return if the page is not a settings page of this plugin
126
+ $settings_page = 'space-x-chimp_page_spacexchimp/' . SPACEXCHIMP_P001_SLUG;
127
+ if ( $settings_page != $current_screen->id ) return;
128
+
129
+ // Filter footer text
130
+ function spacexchimp_p001_new_admin_footer_text() {
131
+ $year = date('Y');
132
+ return "Copyright &copy; " . $year . " <a href='https://www.spacexchimp.com' target='_blank'>Space X-Chimp</a> Studio | Click <a href='https://www.spacexchimp.com/store.html' target='_blank'>here</a> to see my other products.";
133
+ }
134
+ add_filter( 'admin_footer_text', 'spacexchimp_p001_new_admin_footer_text', 11 );
135
+ }
136
+ add_action( 'current_screen', 'spacexchimp_p001_admin_footer_text' );
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: Arthur Gareginyan
7
  * Author URI: https://www.arthurgareginyan.com
8
- * Version: 4.8
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: Arthur Gareginyan
7
  * Author URI: https://www.arthurgareginyan.com
8
+ * Version: 4.9
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.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
5
  Requires at least: 3.9
6
  Tested up to: 4.8
7
- Stable tag: 4.8
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -89,7 +89,7 @@ Manually via FTP access:
89
  4. Log into Admin Panel of your WordPress website.
90
  5. Activate this plugin through the "`Plugins`" tab.
91
 
92
- After installation and activation, the "`PHP Inserter`" menu item will appear in the "`Space X-Chimp`" section. Click on this in order to view plugin administration page.
93
 
94
  [More help installing plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins")
95
 
@@ -196,6 +196,10 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
196
 
197
  == Changelog ==
198
 
 
 
 
 
199
  = 4.8 =
200
  * Added the top level menu item of the brand.
201
  * The submenu item of the plugin has moved to the menu item of the brand.
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.8
7
+ Stable tag: 4.9
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
89
  4. Log into Admin Panel of your WordPress website.
90
  5. Activate this plugin through the "`Plugins`" tab.
91
 
92
+ After installation and activation, the "`PHP Inserter`" menu item will appear in the "`Space X-Chimp`" section of Admin Panel. Click on it in order to view the plugin settings page.
93
 
94
  [More help installing plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins")
95
 
196
 
197
  == Changelog ==
198
 
199
+ = 4.9 =
200
+ * Fixed the issue due tof which the 'Space X-Chimp' sub menu item in the brand menu item was displayed.
201
+ * Added branded footer text on the plugin's settings page.
202
+
203
  = 4.8 =
204
  * Added the top level menu item of the brand.
205
  * The submenu item of the plugin has moved to the menu item of the brand.