first commit
This commit is contained in:
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
|
||||
namespace PixelYourSite;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h2 class="section-title">Head and Footer Settings</h2>
|
||||
|
||||
<!-- General -->
|
||||
<div class="card card-static">
|
||||
<div class="card-header">
|
||||
General
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<?php HeadFooter()->render_switcher_input( 'enabled' ); ?>
|
||||
<h4 class="switcher-label">Enable Head and Footer</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header Scripts -->
|
||||
<div class="card card-static">
|
||||
<div class="card-header">
|
||||
Head Scripts
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Any device type:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'head_any' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Desktop Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'head_desktop' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4 class="label">Mobile Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'head_mobile' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer Scripts -->
|
||||
<div class="card card-static">
|
||||
<div class="card-header">
|
||||
Footer Scripts
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Any device type:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'footer_any' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Desktop Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'footer_desktop' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4 class="label">Mobile Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'footer_mobile' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if( isWooCommerceActive() ) : ?>
|
||||
|
||||
<h2 class="section-title">WooCommerce Order Received Page Scripts</h2>
|
||||
|
||||
<!-- <p>Insert any script on the WooCommerce Thank You Page (order-received).</p>-->
|
||||
|
||||
<div class="card card-static">
|
||||
<div class="card-header">
|
||||
General
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<?php HeadFooter()->render_switcher_input( 'woo_order_received_disable_global' ); ?>
|
||||
<h4 class="switcher-label">Disable global head and footer scripts on Order Received page</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-static">
|
||||
<div class="card-header">
|
||||
Head Scripts
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Any device type:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'woo_order_received_head_any' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Desktop Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'woo_order_received_head_desktop' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4 class="label">Mobile Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'woo_order_received_head_mobile' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-static">
|
||||
<div class="card-header">
|
||||
Footer Scripts
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Any device type:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'woo_order_received_footer_any' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col">
|
||||
<h4 class="label">Desktop Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'woo_order_received_footer_desktop' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4 class="label">Mobile Only:</h4>
|
||||
<?php HeadFooter()->render_text_area_input( 'woo_order_received_footer_mobile' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h2 class="section-title">Replacements <?php renderHfBadge(); ?></h2>
|
||||
|
||||
<div class="panel">
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
<?php include 'html-variables-help.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-4">
|
||||
<button class="btn btn-block btn-save">Save Settings</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace PixelYourSite;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $post;
|
||||
|
||||
$meta = get_post_meta( $post->ID, '_pys_head_footer', true );
|
||||
|
||||
if ( ! is_array( $meta ) ) {
|
||||
|
||||
$meta = array(
|
||||
'disable_global' => false,
|
||||
'head_any' => '',
|
||||
'head_desktop' => '',
|
||||
'head_mobile' => '',
|
||||
'footer_any' => '',
|
||||
'footer_desktop' => '',
|
||||
'footer_mobile' => '',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<style type="text/css">
|
||||
.pys-head-footer label {
|
||||
display: block;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.pys-head-footer textarea {
|
||||
width: 100%;
|
||||
font-family: monospace;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="pys-head-footer">
|
||||
<p>Add any script in the Head or Footer section of your pages. You can also add custom per page scripts
|
||||
by editing each page.</p>
|
||||
</div>
|
||||
|
||||
<div class="pys-head-footer" style="margin: 15px 0;">
|
||||
<label for="pys_head_footer_disable_global" style="font-weight: normal;">
|
||||
<input name="pys_head_footer[disable_global]"
|
||||
type="checkbox"
|
||||
<?php checked( $meta['disable_global'] ); ?>
|
||||
id="pys_head_footer_disable_global"
|
||||
value="1"> Disable <a href="<?php echo admin_url( 'admin.php?page=pixelyoursite&tab=head_footer' ); ?>"
|
||||
target="_blank">global</a> head and footer scripts.
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="pys-head-footer">
|
||||
|
||||
<label for="pys_head_footer_head_any" class="control-label">Head (any device type):</label>
|
||||
<textarea name="pys_head_footer[head_any]" id="pys_head_footer_head_any"
|
||||
rows="10"><?php @esc_html_e( $meta['head_any'] ); ?></textarea>
|
||||
|
||||
<label for="pys_head_footer_head_desktop" class="control-label">Head - Desktop Only:</label>
|
||||
<textarea name="pys_head_footer[head_desktop]" id="pys_head_footer_head_desktop"
|
||||
rows="5"><?php @esc_html_e( $meta['head_desktop'] ); ?></textarea>
|
||||
|
||||
<label for="pys_head_footer_head_mobile" class="control-label">Head - Mobile Only:</label>
|
||||
<textarea name="pys_head_footer[head_mobile]" id="pys_head_footer_head_mobile"
|
||||
rows="5"><?php @esc_html_e( $meta['head_mobile'] ); ?></textarea>
|
||||
|
||||
<hr style="margin-top: 15px;">
|
||||
|
||||
<label for="pys_head_footer_footer_any" class="control-label">Footer (any device type):</label>
|
||||
<textarea name="pys_head_footer[footer_any]" id="pys_head_footer_footer_any"
|
||||
rows="10"><?php @esc_html_e( $meta['footer_any'] ); ?></textarea>
|
||||
|
||||
<label for="pys_head_footer_footer_desktop" class="control-label">Footer - Desktop Only:</label>
|
||||
<textarea name="pys_head_footer[footer_desktop]" id="pys_head_footer_footer_desktop"
|
||||
rows="5"><?php @esc_html_e( $meta['footer_desktop'] ); ?></textarea>
|
||||
|
||||
<label for="pys_head_footer_footer_mobile" class="control-label">Footer - Mobile Only:</label>
|
||||
<textarea name="pys_head_footer[footer_mobile]" id="pys_head_footer_footer_mobile"
|
||||
rows="5"><?php @esc_html_e( $meta['footer_mobile'] ); ?></textarea>
|
||||
|
||||
<hr style="margin-top: 15px;">
|
||||
|
||||
<?php include 'html-variables-help.php'; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="application/javascript">
|
||||
// collapse meta box by default
|
||||
jQuery('#pys-head-footer').addClass('closed');
|
||||
</script>
|
||||
@@ -0,0 +1,17 @@
|
||||
<p>You can use the following variables:</p>
|
||||
<ul>
|
||||
<li><code>[id]</code> - content ID</li>
|
||||
<li><code>[title]</code> - content title</li>
|
||||
<li><code>[categories]</code> - content categories</li>
|
||||
<li><code>[email]</code> - user's email</li>
|
||||
<li><code>[first_name]</code> - user's first name</li>
|
||||
<li><code>[last_name]</code> - user's last name</li>
|
||||
</ul>
|
||||
|
||||
<p>For the WooCommerce or Easy Digital Downloads Thank You Pages only:</p>
|
||||
<ul>
|
||||
<li><code>[order_number]</code> - order number</li>
|
||||
<li><code>[order_subtotal]</code> - order subtotal</li>
|
||||
<li><code>[order_total]</code> - order total</li>
|
||||
<li><code>[currency]</code> - currency</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user