PluginProbe
Add Custom Codes – Insert Header, Footer, Custom PHP Snippets, CSS, Javascript / 4.7
Add Custom Codes – Insert Header, Footer, Custom PHP Snippets, CSS, Javascript v4.7
trunk 1.0 2.0 3.0 3.5 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.71 4.80 5.0
add-custom-codes / single-meta.php

single-meta.php in Add Custom Codes – Insert Header, Footer, Custom PHP Snippets, CSS, Javascript 4.7, at single-meta.php

78 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // If this file was called directly, abort.
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6 ?>
7 <?php
8 function accodes_is_gutenberg_active() {
9 // Check if we're on a post edit screen and Gutenberg is loaded
10 $current_screen = get_current_screen();
11 return (function_exists('is_gutenberg_page') && is_gutenberg_page())
12 || (isset($current_screen->is_block_editor) && $current_screen->is_block_editor)
13 || (defined('REST_REQUEST') && REST_REQUEST);
14 }
15 ?>
16 <div class="acc-ind-col-1 ">
17 <?php wp_nonce_field('accodes_save_meta', 'accodes_meta_nonce'); ?>
18
19 <fieldset class="accodes_ind_field">
20 <div>
21 <p class="acc_info">
22 <label for="_accodes_header_metabox" class="first-label accodes-label green-label">
23 <?php
24 // escape
25 esc_html_e( 'Header Codes', 'add-custom-codes' );
26 ?>
27 </label>
28 <?php esc_html_e( "Codes & scripts to add before <em>&lt;/head&gt;</em> section of this page. Use <em>&lt;script&gt; &lt;/script&gt;</em>, <em>&lt;style&gt; &lt;/style&gt;</em> tags when necessary.", 'add-custom-codes' ); ?>
29 </p>
30 <textarea
31 type="text"
32 name="_accodes_header_metabox"
33 id="_accodes_header_metabox" class="<?php if (!accodes_is_gutenberg_active()) { echo "codemirror small-codemirror";} ?>"
34 ><?php echo esc_textarea($header_script) ; ?></textarea>
35 </div>
36 <p>
37 <label for="accodes_hide_header" class="accodes-checkbox-label ">
38 <input type="checkbox" <?php echo checked( $hide_header, 'on', false ) ?>
39 name="accodes_hide_header" id="accodes_hide_header"/>
40 <?php esc_html_e( "Hide Global Header Codes on this page", 'add-custom-codes' ); ?>
41 </label>
42 <?php esc_html_e( "Go to <em>Appearance -> Add Custom Codes</em> to see your Global Header Codes", 'add-custom-codes' ); ?>
43 </p>
44 </fieldset>
45
46 <fieldset class="accodes_ind_field">
47 <div>
48 <p class="acc_info">
49 <label for="_accodes_footer_metabox" class="accodes-label green-label">
50 <?php
51 esc_html_e( 'Footer Codes', 'add-custom-codes' );
52 ?>
53 </label>
54 <?php esc_html_e( "Codes & scripts to add before <em>&lt;/body&gt;</em> section of this page. Use <em>&lt;script&gt; &lt;/script&gt;</em>, <em>&lt;style&gt; &lt;/style&gt;</em> tags when necessary.", 'add-custom-codes' ); ?>
55 </p>
56 <textarea
57 type="text"
58 name="_accodes_footer_metabox"
59 id="_accodes_footer_metabox" class="<?php if (!accodes_is_gutenberg_active()) { echo "codemirror small-codemirror";} ?>"
60 ><?php echo esc_textarea($footer_script) ; ?></textarea>
61 <p>
62 <label for="accodes_hide_footer" class="accodes-checkbox-label">
63 <input type="checkbox" <?php echo checked( $hide_footer, 'on', false ) ?>
64 name="accodes_hide_footer" id="accodes_hide_footer"/>
65 <?php esc_html_e( "Hide Global Footer Codes on this page", 'add-custom-codes' ); ?>
66 </label>
67 <?php esc_html_e( "Go to <em>Appearance -> Add Custom Codes</em> to see your Global Footer Codes", 'add-custom-codes' ); ?>
68 </p>
69 </div>
70 </fieldset>
71
72 </div>
73 <div class="acc-ind-col-2">
74 <p>
75 <em>Add Custom Codes by Mak</em> plugin is <span>Free Forever</span> to use! <a class="acc-link1" href="https://donate.stripe.com/9AQdRz5xJ87c9i0bIS" target="_blank">Donate</a> or <a class="acc-link1" href="https://maktalseo.com/" target="_blank">Hire us for your next project</a> to support us!
76 </p>
77 </div>
78 <div style="clear:both;"></div>