Head and Footer Scripts Inserter - Version 4.11

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.
  • Text of copyright in the output code is updated.
Download this release

Release Info

Developer Arthur Gareginyan
Plugin Icon 128x128 Head and Footer Scripts Inserter
Version 4.11
Comparing to
See all releases

Code changes from version 4.10 to 4.11

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: https://www.arthurgareginyan.com
8
- * Version: 4.10
9
  * License: GPL3
10
  * Text Domain: header-and-footer-scripts-inserter
11
  * Domain Path: /languages/
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: https://www.arthurgareginyan.com
8
+ * Version: 4.11
9
  * License: GPL3
10
  * Text Domain: header-and-footer-scripts-inserter
11
  * Domain Path: /languages/
inc/php/core.php CHANGED
@@ -79,6 +79,20 @@ function spacexchimp_p006_register_submenu_page() {
79
  }
80
  add_action( 'admin_menu', 'spacexchimp_p006_register_submenu_page' );
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * Register settings
84
  */
@@ -87,3 +101,24 @@ function spacexchimp_p006_register_settings() {
87
  register_setting( SPACEXCHIMP_P006_SETTINGS . '_settings_group_si', SPACEXCHIMP_P006_SETTINGS . '_service_info' );
88
  }
89
  add_action( 'admin_init', 'spacexchimp_p006_register_settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
  add_action( 'admin_menu', 'spacexchimp_p006_register_submenu_page' );
81
 
82
+ /**
83
+ * Remove the 'Space X-Chimp' sub menu item in the brand menu item
84
+ */
85
+ function spacexchimp_p006_remove_submenu_item() {
86
+
87
+ // Read global variable
88
+ global $submenu;
89
+
90
+ if ( isset( $submenu['spacexchimp'] ) ) {
91
+ unset( $submenu['spacexchimp'][0] );
92
+ }
93
+ }
94
+ add_action( 'admin_menu', 'spacexchimp_p006_remove_submenu_item' );
95
+
96
  /**
97
  * Register settings
98
  */
101
  register_setting( SPACEXCHIMP_P006_SETTINGS . '_settings_group_si', SPACEXCHIMP_P006_SETTINGS . '_service_info' );
102
  }
103
  add_action( 'admin_init', 'spacexchimp_p006_register_settings' );
104
+
105
+ /**
106
+ * Branded footer text on the plugin's settings page
107
+ */
108
+ function spacexchimp_p006_admin_footer_text() {
109
+
110
+ // Get current screen data
111
+ $current_screen = get_current_screen();
112
+
113
+ // Return if the page is not a settings page of this plugin
114
+ $settings_page = 'space-x-chimp_page_spacexchimp/' . SPACEXCHIMP_P006_SLUG;
115
+ if ( $settings_page != $current_screen->id ) return;
116
+
117
+ // Filter footer text
118
+ function spacexchimp_p006_new_admin_footer_text() {
119
+ $year = date('Y');
120
+ 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.";
121
+ }
122
+ add_filter( 'admin_footer_text', 'spacexchimp_p006_new_admin_footer_text', 11 );
123
+ }
124
+ add_action( 'current_screen', 'spacexchimp_p006_admin_footer_text' );
inc/php/functional.php CHANGED
@@ -41,9 +41,9 @@ function spacexchimp_p006_output( $option ) {
41
  }
42
 
43
  // Add comments to output
44
- $data_out = "\n<!-- [BEGIN] Scripts added via Head-and-Footer-Scripts-Inserter plugin by Arthur Gareginyan. -->\n";
45
  $data_out .= $data;
46
- $data_out .= "\n<!-- [END] Scripts added via Head-and-Footer-Scripts-Inserter plugin by Arthur Gareginyan. -->\n\n";
47
 
48
  // Output
49
  echo $data_out;
41
  }
42
 
43
  // Add comments to output
44
+ $data_out = "\n<!-- [BEGIN] Scripts added via Head-and-Footer-Scripts-Inserter plugin by Space X-Chimp Studio ( https://www.spacexchimp.com ) -->\n";
45
  $data_out .= $data;
46
+ $data_out .= "\n<!-- [END] Scripts added via Head-and-Footer-Scripts-Inserter plugin by Space X-Chimp Studio ( https://www.spacexchimp.com ) -->\n\n";
47
 
48
  // Output
49
  echo $data_out;
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.8
7
- Stable tag: 4.10
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -82,7 +82,7 @@ Manually via FTP access:
82
  4. Log into Admin Panel of your WordPress website.
83
  5. Activate this plugin through the "`Plugins`" tab.
84
 
85
- After installation and activation, the "`Scripts Inserter`" menu item will appear in the "`Space X-Chimp`" section. Click on this in order to view plugin administration page.
86
 
87
  [More help installing plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins")
88
 
@@ -175,6 +175,11 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
178
  = 4.10 =
179
  * Error in the PHP constant name fixed.
180
 
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.11
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
82
  4. Log into Admin Panel of your WordPress website.
83
  5. Activate this plugin through the "`Plugins`" tab.
84
 
85
+ After installation and activation, the "`Scripts 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.
86
 
87
  [More help installing plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins")
88
 
175
 
176
  == Changelog ==
177
 
178
+ = 4.11 =
179
+ * Fixed the issue due tof which the 'Space X-Chimp' sub menu item in the brand menu item was displayed.
180
+ * Added branded footer text on the plugin's settings page.
181
+ * Text of copyright in the output code is updated.
182
+
183
  = 4.10 =
184
  * Error in the PHP constant name fixed.
185