Version Description
Download this release
Release Info
Developer | anand_kumar |
Plugin | Header and Footer Scripts |
Version | 2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.2.1
- inc/meta.php +3 -4
- inc/options.php +15 -9
- inc/sidebar.php +13 -13
- readme.txt +22 -11
- shfs.php +11 -9
inc/meta.php
CHANGED
@@ -4,15 +4,14 @@
|
|
4 |
*
|
5 |
* @package Header and Footer Scripts
|
6 |
* @author Anand Kumar <anand@anandkumar.net>
|
7 |
-
* @copyright Copyright (c) 2013 -
|
8 |
* @link http://digitalliberation.org/plugins/header-and-footer-scripts
|
9 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
*/?>
|
11 |
<div class="shfs_meta_control">
|
12 |
|
|
|
13 |
<p>
|
14 |
-
<textarea name="_inpost_head_script[synth_header_script]" rows="5" style="width:98%;"><?php if(!empty($meta['synth_header_script'])) echo $meta['synth_header_script']; ?></textarea>
|
15 |
</p>
|
16 |
-
|
17 |
-
<p><?php _e('Add some code to <code><head></code>', 'header-and-footer-scripts'); ?>.</p>
|
18 |
</div>
|
4 |
*
|
5 |
* @package Header and Footer Scripts
|
6 |
* @author Anand Kumar <anand@anandkumar.net>
|
7 |
+
* @copyright Copyright (c) 2013 - 2020, Anand Kumar
|
8 |
* @link http://digitalliberation.org/plugins/header-and-footer-scripts
|
9 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
*/?>
|
11 |
<div class="shfs_meta_control">
|
12 |
|
13 |
+
<p><?php esc_html_e('The script in the following textbox will be inserted to the <head> section', 'header-and-footer-scripts'); ?>.</p>
|
14 |
<p>
|
15 |
+
<textarea name="_inpost_head_script[synth_header_script]" rows="5" style="width:98%;font-family:monospace;"><?php if(!empty($meta['synth_header_script'])) echo $meta['synth_header_script']; ?></textarea>
|
16 |
</p>
|
|
|
|
|
17 |
</div>
|
inc/options.php
CHANGED
@@ -4,12 +4,12 @@
|
|
4 |
*
|
5 |
* @package Header and Footer Scripts
|
6 |
* @author Anand Kumar <anand@anandkumar.net>
|
7 |
-
* @copyright Copyright (c) 2013 -
|
8 |
* @link http://digitalliberation.org/plugins/header-and-footer-scripts
|
9 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
*/?>
|
11 |
<div class="wrap">
|
12 |
-
<h2><?php
|
13 |
|
14 |
<hr />
|
15 |
<div id="poststuff">
|
@@ -21,16 +21,22 @@
|
|
21 |
|
22 |
<?php settings_fields( 'header-and-footer-scripts' ); ?>
|
23 |
|
24 |
-
<h3 class="shfs-labels" for="shfs_insert_header"><?php
|
25 |
-
<
|
26 |
-
<
|
27 |
|
28 |
-
<
|
29 |
-
<
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
<p class="submit">
|
33 |
-
<input class="button button-primary" type="submit" name="Submit" value="<?php
|
34 |
</p>
|
35 |
|
36 |
</form>
|
4 |
*
|
5 |
* @package Header and Footer Scripts
|
6 |
* @author Anand Kumar <anand@anandkumar.net>
|
7 |
+
* @copyright Copyright (c) 2013 - 2020, Anand Kumar
|
8 |
* @link http://digitalliberation.org/plugins/header-and-footer-scripts
|
9 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
*/?>
|
11 |
<div class="wrap">
|
12 |
+
<h2><?php esc_html_e( 'Header and Footer Scripts - Options', 'header-and-footer-scripts'); ?> <a class="add-new-h2" target="_blank" href="<?php echo esc_url( "https://digitalliberation.org/docs/header-and-footer-scripts/?utm_source=wpdash_hfs" ); ?>"><?php esc_html_e( 'Read Tutorial', 'header-and-footer-scripts'); ?></a></h2>
|
13 |
|
14 |
<hr />
|
15 |
<div id="poststuff">
|
21 |
|
22 |
<?php settings_fields( 'header-and-footer-scripts' ); ?>
|
23 |
|
24 |
+
<h3 class="shfs-labels" for="shfs_insert_header"><?php esc_html_e( 'Scripts in header:', 'header-and-footer-scripts'); ?></h3>
|
25 |
+
<p><?php esc_html_e( 'The following script, if any, will be inserted into the <head> section using wp_head hook.', 'header-and-footer-scripts'); ?></p>
|
26 |
+
<textarea style="width:98%;font-family:monospace;" rows="10" cols="57" id="insert_header" name="shfs_insert_header"><?php echo esc_html( get_option( 'shfs_insert_header' ) ); ?></textarea>
|
27 |
|
28 |
+
<p><label for="shfs_insert_header_priority"><?php esc_html_e('Priority', 'header-and-footer-scripts'); ?></label>
|
29 |
+
<input type="number" value="<?php echo \esc_html( \get_option( 'shfs_insert_header_priority', 10 ) ); ?>" name="shfs_insert_header_priority" id="shfs_insert_header_priority" style="width:6em;" /> <?php \esc_html_e('Default', 'header-and-footer-scripts'); ?>: 10</p><hr />
|
30 |
+
|
31 |
+
<h3 class="shfs-labels footerlabel" for="shfs_insert_footer"><?php esc_html_e( 'Scripts in footer:', 'header-and-footer-scripts'); ?></h3>
|
32 |
+
<p><?php esc_html_e( 'The following script, if any, will be inserted before </body> tag using wp_footer hook.', 'header-and-footer-scripts'); ?></p>
|
33 |
+
<textarea style="width:98%;font-family:monospace;" rows="10" cols="57" id="shfs_insert_footer" name="shfs_insert_footer"><?php echo esc_html( get_option( 'shfs_insert_footer' ) ); ?></textarea>
|
34 |
+
|
35 |
+
<p><label for="shfs_insert_footer_priority"><?php _e('Priority'); ?></label>
|
36 |
+
<input type="number" value="<?php echo \esc_html( \get_option( 'shfs_insert_footer_priority', 10 ) ); ?>" name="shfs_insert_footer_priority" id="shfs_insert_footer_priority" style="width:6em;" /> <?php \esc_html_e('Default', 'header-and-footer-scripts'); ?>: 10</p>
|
37 |
|
38 |
<p class="submit">
|
39 |
+
<input class="button button-primary" type="submit" name="Submit" value="<?php esc_html_e( 'Save settings', 'header-and-footer-scripts'); ?>" />
|
40 |
</p>
|
41 |
|
42 |
</form>
|
inc/sidebar.php
CHANGED
@@ -4,41 +4,41 @@
|
|
4 |
*
|
5 |
* @package Header and Footer Scripts
|
6 |
* @author Anand Kumar <anand@anandkumar.net>
|
7 |
-
* @copyright Copyright (c) 2013 -
|
8 |
* @link http://digitalliberation.org/plugins/header-and-footer-scripts
|
9 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
*/?>
|
11 |
<div id="postbox-container-1" class="postbox-container">
|
12 |
|
13 |
<div class="postbox">
|
14 |
-
<h3 class="hndle"><?php
|
15 |
<div class="inside">
|
16 |
-
<p><?php
|
17 |
-
<p><strong><a href="<?php echo esc_url( "http://digitalliberation.org/plugins/header-and-footer-scripts/?utm_source=wpdash_hfs" ); ?>" class="button"><?php
|
18 |
</div>
|
19 |
</div>
|
20 |
|
21 |
<div class="postbox">
|
22 |
-
<h3 class="hndle"><?php
|
23 |
<div class="inside">
|
24 |
-
<p><?php
|
25 |
-
<p><a href="<?php echo esc_url( "http://digitalliberation.org/contribute/?utm_source=wpdash_hfs" ); ?>" class="button"><?php
|
26 |
</div>
|
27 |
</div>
|
28 |
|
29 |
<div class="postbox">
|
30 |
-
<h3 class="hndle"><?php
|
31 |
<div class="inside">
|
32 |
-
<p><?php
|
33 |
-
<p><a href="<?php echo esc_url( "https://wordpress.org/support/plugin/header-and-footer-scripts/reviews/?filter=5#new-post" ); ?>" class="button"><?php
|
34 |
</div>
|
35 |
</div>
|
36 |
|
37 |
<div class="postbox">
|
38 |
-
<h3 class="hndle"><?php
|
39 |
<div class="inside">
|
40 |
-
<p><?php
|
41 |
-
<p><a href="<?php echo esc_url( "http://digitalliberation.org/?utm_source=wpdash_hfs" ); ?>" class="button"><?php
|
42 |
</div>
|
43 |
</div>
|
44 |
|
4 |
*
|
5 |
* @package Header and Footer Scripts
|
6 |
* @author Anand Kumar <anand@anandkumar.net>
|
7 |
+
* @copyright Copyright (c) 2013 - 2020, Anand Kumar
|
8 |
* @link http://digitalliberation.org/plugins/header-and-footer-scripts
|
9 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
*/?>
|
11 |
<div id="postbox-container-1" class="postbox-container">
|
12 |
|
13 |
<div class="postbox">
|
14 |
+
<h3 class="hndle"><?php esc_html_e( 'Need Help?', 'header-and-footer-scripts'); ?></h3>
|
15 |
<div class="inside">
|
16 |
+
<p><?php esc_html_e( 'Read plugin documentation for clarification or how to use it. OR just ask your query.', 'header-and-footer-scripts'); ?></p>
|
17 |
+
<p><strong><a href="<?php echo esc_url( "http://digitalliberation.org/plugins/header-and-footer-scripts/?utm_source=wpdash_hfs" ); ?>" class="button"><?php esc_html_e('Explore Docs and Support', 'header-and-footer-scripts'); ?></a></strong></p>
|
18 |
</div>
|
19 |
</div>
|
20 |
|
21 |
<div class="postbox">
|
22 |
+
<h3 class="hndle"><?php esc_html_e( 'Contribute or Donate!', 'header-and-footer-scripts'); ?></h3>
|
23 |
<div class="inside">
|
24 |
+
<p><?php esc_html_e( 'Help us to make this plugin even better. Contributions not necessarily be monetary. Please follow the link to know more and contribute.', 'header-and-footer-scripts'); ?></p>
|
25 |
+
<p><a href="<?php echo esc_url( "http://digitalliberation.org/contribute/?utm_source=wpdash_hfs" ); ?>" class="button"><?php esc_html_e( 'Contribute', 'header-and-footer-scripts'); ?></a></p>
|
26 |
</div>
|
27 |
</div>
|
28 |
|
29 |
<div class="postbox">
|
30 |
+
<h3 class="hndle"><?php esc_html_e( 'Rate 5 Stars', 'header-and-footer-scripts'); ?></h3>
|
31 |
<div class="inside">
|
32 |
+
<p><?php esc_html_e( 'Find this plugin useful rate it 5 stars and leave a nice little comment at wordpress.org. I would really appreciate that.', 'header-and-footer-scripts'); ?></p>
|
33 |
+
<p><a href="<?php echo esc_url( "https://wordpress.org/support/plugin/header-and-footer-scripts/reviews/?filter=5#new-post" ); ?>" class="button"><?php esc_html_e( 'Rate 5 Stars', 'header-and-footer-scripts'); ?></a></p>
|
34 |
</div>
|
35 |
</div>
|
36 |
|
37 |
<div class="postbox">
|
38 |
+
<h3 class="hndle"><?php esc_html_e( 'Join Our Community', 'header-and-footer-scripts'); ?></h3>
|
39 |
<div class="inside">
|
40 |
+
<p><?php esc_html_e( 'We are small WordPress community who welcomes you to join us. Here you will find and share more plugins and themes or even ideas. Ideas are not limited to WordPress. It could be vague or liberal. This is why we are "Digital Liberation .ORG', 'header-and-footer-scripts'); ?></p>
|
41 |
+
<p><a href="<?php echo esc_url( "http://digitalliberation.org/?utm_source=wpdash_hfs" ); ?>" class="button"><?php esc_html_e( 'Join Digital Liberation', 'header-and-footer-scripts'); ?></a></p>
|
42 |
</div>
|
43 |
</div>
|
44 |
|
readme.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
=== Header and Footer Scripts ===
|
2 |
|
3 |
Contributors: digitalliberation, anand_kumar
|
4 |
-
Donate link:
|
5 |
Tags: head, header, footer, scripts, post, admin
|
6 |
Requires at least: 4.0
|
7 |
-
Tested up to: 4
|
8 |
-
Stable tag: 2.1
|
9 |
-
Requires PHP: 5.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -32,14 +32,14 @@ Or for CSS:
|
|
32 |
= Why use this plugin: =
|
33 |
* To insert CSS and JavaScript codes to `<head>` or before `</body>`.
|
34 |
* To insert code to `<head>` of any single page or post.
|
35 |
-
* To insert code to Custom Post Type [New Feature].
|
36 |
|
37 |
The plugin should be compatible with WooCommerce.
|
38 |
|
39 |
= What it does not offer =
|
40 |
* You can't insert/execute PHP codes.
|
41 |
|
42 |
-
Almost all WordPress theme do support this "Header and Footer Scripts" plugin. If the codes are not appearing in your site [ask for support] or look at your theme file if they have standard `wp_head` and `wp_footer` hooks.
|
43 |
|
44 |
= Important Links =
|
45 |
For furhter information you are welcomed to follow these links:
|
@@ -50,11 +50,11 @@ For furhter information you are welcomed to follow these links:
|
|
50 |
* **[Contribute][4]**
|
51 |
* **[Digital Liberation - Blog][5]**
|
52 |
|
53 |
-
[1]:
|
54 |
-
[2]:
|
55 |
[3]: https://github.com/anandkumar/header-and-footer-scripts
|
56 |
-
[4]:
|
57 |
-
[5]:
|
58 |
|
59 |
== Installation ==
|
60 |
There is nothing special about installation of this plugin. It is as simple as uploading the plugin files to your plugins directory.
|
@@ -71,7 +71,7 @@ Once the plugin is activated you will see "Header and Footer Scripts" menu item
|
|
71 |
|
72 |
**Q. How could I access support and troubleshoot problem?**
|
73 |
|
74 |
-
A. I couldn't handle wp.org forums on regular basis. You are suggested to visit [Digital Liberation](https://digitalliberation.org/) for more updated plugin documentation and troubleshoot your problem.
|
75 |
|
76 |
**Q: Is there any paid version of the plugin available?**
|
77 |
|
@@ -79,6 +79,17 @@ A. Nope, There is none. If you need more feature send us feedback or feature req
|
|
79 |
|
80 |
== Changelog ==
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
= 2.1.0 =
|
83 |
* Support to Custom Post Type (CPT).
|
84 |
* Improved ReadMe
|
1 |
=== Header and Footer Scripts ===
|
2 |
|
3 |
Contributors: digitalliberation, anand_kumar
|
4 |
+
Donate link: https://www.digitalliberation.org/contribute/?utm_source=wphfs_donate_link
|
5 |
Tags: head, header, footer, scripts, post, admin
|
6 |
Requires at least: 4.0
|
7 |
+
Tested up to: 5.4
|
8 |
+
Stable tag: 2.2.1
|
9 |
+
Requires PHP: 5.6
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
32 |
= Why use this plugin: =
|
33 |
* To insert CSS and JavaScript codes to `<head>` or before `</body>`.
|
34 |
* To insert code to `<head>` of any single page or post.
|
35 |
+
* To insert code to Custom Post Type [New Feature].
|
36 |
|
37 |
The plugin should be compatible with WooCommerce.
|
38 |
|
39 |
= What it does not offer =
|
40 |
* You can't insert/execute PHP codes.
|
41 |
|
42 |
+
Almost all WordPress theme do support this "Header and Footer Scripts" plugin. If the codes are not appearing in your site [ask for support] or look at your theme file if they have standard `wp_head` and `wp_footer` hooks.
|
43 |
|
44 |
= Important Links =
|
45 |
For furhter information you are welcomed to follow these links:
|
50 |
* **[Contribute][4]**
|
51 |
* **[Digital Liberation - Blog][5]**
|
52 |
|
53 |
+
[1]: https://www.digitalliberation.org/docs/header-and-footer-scripts/?utm_source=wporg&utm_medium=wppluginpage&utm_campaign=wp_hfs
|
54 |
+
[2]: https://forums.digitalliberation.org/?utm_source=wporg&utm_medium=wppluginpage&utm_campaign=wp_hfs
|
55 |
[3]: https://github.com/anandkumar/header-and-footer-scripts
|
56 |
+
[4]: https://www.digitalliberation.org/contribute/?utm_source=wporg&utm_medium=donation_link&utm_campaign=wp_hfs
|
57 |
+
[5]: https://www.digitalliberation.org/blog/?utm_source=wporg&utm_medium=wppluginpage&utm_campaign=wp_hfs
|
58 |
|
59 |
== Installation ==
|
60 |
There is nothing special about installation of this plugin. It is as simple as uploading the plugin files to your plugins directory.
|
71 |
|
72 |
**Q. How could I access support and troubleshoot problem?**
|
73 |
|
74 |
+
A. I couldn't handle wp.org forums on regular basis. You are suggested to visit [Digital Liberation](https://forum.digitalliberation.org/) for more updated plugin documentation and troubleshoot your problem.
|
75 |
|
76 |
**Q: Is there any paid version of the plugin available?**
|
77 |
|
79 |
|
80 |
== Changelog ==
|
81 |
|
82 |
+
= 2.2.0 =
|
83 |
+
* New feature: Now set priority to sitewide script.
|
84 |
+
* Fix: Monoscript font for text area.
|
85 |
+
* Improved readme.txt.
|
86 |
+
* Reverted to PHP v5.6 as many people can't move to latest one.
|
87 |
+
|
88 |
+
= 2.1.1 =
|
89 |
+
* Fixed a bug causing singular post type scripts to appear in archives.
|
90 |
+
* Compatibility checked upto WordPress 5.2.2
|
91 |
+
* Now require PHP v7.0 at least.
|
92 |
+
|
93 |
= 2.1.0 =
|
94 |
* Support to Custom Post Type (CPT).
|
95 |
* Improved ReadMe
|
shfs.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Header and Footer Scripts
|
4 |
* Plugin URI: http://digitalliberation.org/plugins/header-and-footer-scripts/?utm_source=wphfs_plugin_uri
|
5 |
-
* Description:
|
6 |
-
* Version: 2.1
|
7 |
* Author: Digital Liberation
|
8 |
* Author URI: http://digitalliberation.org/?utm_source=wphfs_author_uri
|
9 |
* Text Domain: header-and-footer-scripts
|
@@ -13,7 +13,7 @@
|
|
13 |
|
14 |
/*
|
15 |
Header and Footer Scripts
|
16 |
-
Copyright (C) 2013 -
|
17 |
|
18 |
This program is free software; you can redistribute it and/or modify
|
19 |
it under the terms of the GNU General Public License, version 2, as
|
@@ -40,8 +40,8 @@ if ( !class_exists( 'HeaderAndFooterScripts' ) ) {
|
|
40 |
add_action( 'init', array( &$this, 'init' ) );
|
41 |
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
42 |
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
43 |
-
add_action( 'wp_head', array( &$this, 'wp_head' ) );
|
44 |
-
add_action( 'wp_footer', array( &$this, 'wp_footer' ) );
|
45 |
|
46 |
}
|
47 |
|
@@ -55,6 +55,8 @@ if ( !class_exists( 'HeaderAndFooterScripts' ) ) {
|
|
55 |
// register settings for sitewide script
|
56 |
register_setting( 'header-and-footer-scripts', 'shfs_insert_header', 'trim' );
|
57 |
register_setting( 'header-and-footer-scripts', 'shfs_insert_footer', 'trim' );
|
|
|
|
|
58 |
|
59 |
// add meta box to all post types
|
60 |
foreach ( get_post_types( '', 'names' ) as $type ) {
|
@@ -66,7 +68,7 @@ if ( !class_exists( 'HeaderAndFooterScripts' ) ) {
|
|
66 |
|
67 |
// adds menu item to wordpress admin dashboard
|
68 |
function admin_menu() {
|
69 |
-
$page = add_submenu_page( 'options-general.php',
|
70 |
}
|
71 |
|
72 |
function wp_head() {
|
@@ -76,7 +78,7 @@ if ( !class_exists( 'HeaderAndFooterScripts' ) ) {
|
|
76 |
}
|
77 |
|
78 |
$shfs_post_meta = get_post_meta( get_the_ID(), '_inpost_head_script' , TRUE );
|
79 |
-
if ( $shfs_post_meta != '' ) {
|
80 |
echo $shfs_post_meta['synth_header_script'], "\n";
|
81 |
}
|
82 |
|
@@ -124,12 +126,12 @@ if ( !class_exists( 'HeaderAndFooterScripts' ) ) {
|
|
124 |
// check user permissions
|
125 |
if ( $_POST['post_type'] == 'page' ) {
|
126 |
|
127 |
-
if (!current_user_can('edit_page', $post_id))
|
128 |
return $post_id;
|
129 |
|
130 |
} else {
|
131 |
|
132 |
-
if (!current_user_can('edit_post', $post_id))
|
133 |
return $post_id;
|
134 |
|
135 |
}
|
2 |
/**
|
3 |
* Plugin Name: Header and Footer Scripts
|
4 |
* Plugin URI: http://digitalliberation.org/plugins/header-and-footer-scripts/?utm_source=wphfs_plugin_uri
|
5 |
+
* Description: Essential WordPress plugin for almost every website to insert codes like Javascript and CSS. Inserting script to your wp_head and wp_footer made easy.
|
6 |
+
* Version: 2.2.1
|
7 |
* Author: Digital Liberation
|
8 |
* Author URI: http://digitalliberation.org/?utm_source=wphfs_author_uri
|
9 |
* Text Domain: header-and-footer-scripts
|
13 |
|
14 |
/*
|
15 |
Header and Footer Scripts
|
16 |
+
Copyright (C) 2013 - 2020, Anand Kumar <anand@anandkumar.net>
|
17 |
|
18 |
This program is free software; you can redistribute it and/or modify
|
19 |
it under the terms of the GNU General Public License, version 2, as
|
40 |
add_action( 'init', array( &$this, 'init' ) );
|
41 |
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
42 |
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
43 |
+
add_action( 'wp_head', array( &$this, 'wp_head' ), \get_option('shfs_insert_header_priority', 10) );
|
44 |
+
add_action( 'wp_footer', array( &$this, 'wp_footer' ), \get_option('shfs_insert_footer_priority', 10) );
|
45 |
|
46 |
}
|
47 |
|
55 |
// register settings for sitewide script
|
56 |
register_setting( 'header-and-footer-scripts', 'shfs_insert_header', 'trim' );
|
57 |
register_setting( 'header-and-footer-scripts', 'shfs_insert_footer', 'trim' );
|
58 |
+
register_setting( 'header-and-footer-scripts', 'shfs_insert_header_priority', 'intval' );
|
59 |
+
register_setting( 'header-and-footer-scripts', 'shfs_insert_footer_priority', 'intval' );
|
60 |
|
61 |
// add meta box to all post types
|
62 |
foreach ( get_post_types( '', 'names' ) as $type ) {
|
68 |
|
69 |
// adds menu item to wordpress admin dashboard
|
70 |
function admin_menu() {
|
71 |
+
$page = add_submenu_page( 'options-general.php', esc_html__('Header and Footer Scripts', 'header-and-footer-scripts'), esc_html__('Header and Footer Scripts', 'header-and-footer-scripts'), 'manage_options', __FILE__, array( &$this, 'shfs_options_panel' ) );
|
72 |
}
|
73 |
|
74 |
function wp_head() {
|
78 |
}
|
79 |
|
80 |
$shfs_post_meta = get_post_meta( get_the_ID(), '_inpost_head_script' , TRUE );
|
81 |
+
if ( is_singular() && $shfs_post_meta != '' ) {
|
82 |
echo $shfs_post_meta['synth_header_script'], "\n";
|
83 |
}
|
84 |
|
126 |
// check user permissions
|
127 |
if ( $_POST['post_type'] == 'page' ) {
|
128 |
|
129 |
+
if (!current_user_can('edit_page', $post_id))
|
130 |
return $post_id;
|
131 |
|
132 |
} else {
|
133 |
|
134 |
+
if (!current_user_can('edit_post', $post_id))
|
135 |
return $post_id;
|
136 |
|
137 |
}
|