This commit is contained in:
2026-04-26 23:47:49 +02:00
parent 1b95f03d1e
commit b073e009d8
5288 changed files with 1112699 additions and 55536 deletions

View File

@@ -0,0 +1,401 @@
/**
* selectize.bootstrap3.css (v0.12.1) - Bootstrap 3 Theme
* Copyright (c) 20132015 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at:
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*
* @author Brian Reavis <brian@thirdroute.com>
*/
.selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
visibility: visible !important;
background: #f2f2f2 !important;
background: rgba(0, 0, 0, 0.06) !important;
border: 0 none !important;
-webkit-box-shadow: inset 0 0 12px 4px #ffffff;
box-shadow: inset 0 0 12px 4px #ffffff;
}
.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after {
content: '!';
visibility: hidden;
}
.selectize-control.plugin-drag_drop .ui-sortable-helper {
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.selectize-dropdown-header {
position: relative;
padding: 3px 12px;
border-bottom: 1px solid #d0d0d0;
background: #f8f8f8;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
.selectize-dropdown-header-close {
position: absolute;
right: 12px;
top: 50%;
color: #333333;
opacity: 0.4;
margin-top: -12px;
line-height: 20px;
font-size: 20px !important;
}
.selectize-dropdown-header-close:hover {
color: #000000;
}
.selectize-dropdown.plugin-optgroup_columns .optgroup {
border-right: 1px solid #f2f2f2;
border-top: 0 none;
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child {
border-right: 0 none;
}
.selectize-dropdown.plugin-optgroup_columns .optgroup:before {
display: none;
}
.selectize-dropdown.plugin-optgroup_columns .optgroup-header {
border-top: 0 none;
}
.selectize-control.plugin-remove_button [data-value] {
position: relative;
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button [data-value] .remove {
z-index: 1;
/* fixes ie bug (see #392) */
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 17px;
text-align: center;
font-weight: bold;
font-size: 12px;
color: inherit;
text-decoration: none;
vertical-align: middle;
display: inline-block;
padding: 1px 0 0 0;
border-left: 1px solid rgba(0, 0, 0, 0);
-webkit-border-radius: 0 2px 2px 0;
-moz-border-radius: 0 2px 2px 0;
border-radius: 0 2px 2px 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.selectize-control.plugin-remove_button [data-value] .remove:hover {
background: rgba(0, 0, 0, 0.05);
}
.selectize-control.plugin-remove_button [data-value].active .remove {
border-left-color: rgba(0, 0, 0, 0);
}
.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover {
background: none;
}
.selectize-control.plugin-remove_button .disabled [data-value] .remove {
border-left-color: rgba(77, 77, 77, 0);
}
.selectize-control {
position: relative;
}
.selectize-dropdown,
.selectize-input,
.selectize-input input {
color: #333333;
font-family: inherit;
font-size: inherit;
line-height: 20px;
-webkit-font-smoothing: inherit;
}
.selectize-input,
.selectize-control.single .selectize-input.input-active {
background: #ffffff;
cursor: text;
display: inline-block;
}
.selectize-input {
border: 1px solid #cccccc;
padding: 6px 12px;
display: inline-block;
width: 100%;
overflow: hidden;
position: relative;
z-index: 1;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.selectize-control.multi .selectize-input.has-items {
padding: 5px 12px 2px;
}
.selectize-input.full {
background-color: #ffffff;
}
.selectize-input.disabled,
.selectize-input.disabled * {
cursor: default !important;
}
.selectize-input.focus {
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}
.selectize-input.dropdown-active {
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
.selectize-input > * {
vertical-align: baseline;
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
*display: inline;
}
.selectize-control.multi .selectize-input > div {
cursor: pointer;
margin: 0 3px 3px 0;
padding: 1px 3px;
background: #efefef;
color: #333333;
border: 0 solid rgba(0, 0, 0, 0);
}
.selectize-control.multi .selectize-input > div.active {
background: #428bca;
color: #ffffff;
border: 0 solid rgba(0, 0, 0, 0);
}
.selectize-control.multi .selectize-input.disabled > div,
.selectize-control.multi .selectize-input.disabled > div.active {
color: #808080;
background: #ffffff;
border: 0 solid rgba(77, 77, 77, 0);
}
.selectize-input > input {
display: inline-block !important;
padding: 0 !important;
min-height: 0 !important;
max-height: none !important;
max-width: 100% !important;
margin: 0 !important;
text-indent: 0 !important;
border: 0 none !important;
background: none !important;
line-height: inherit !important;
-webkit-user-select: auto !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input::-ms-clear {
display: none;
}
.selectize-input > input:focus {
outline: none !important;
}
.selectize-input::after {
content: ' ';
display: block;
clear: left;
}
.selectize-input.dropdown-active::before {
content: ' ';
display: block;
position: absolute;
background: #ffffff;
height: 1px;
bottom: 0;
left: 0;
right: 0;
}
.selectize-dropdown {
position: absolute;
z-index: 10;
border: 1px solid #d0d0d0;
background: #ffffff;
margin: -1px 0 0 0;
border-top: 0 none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.selectize-dropdown [data-selectable] {
cursor: pointer;
overflow: hidden;
}
.selectize-dropdown [data-selectable] .highlight {
background: rgba(255, 237, 40, 0.4);
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
}
.selectize-dropdown [data-selectable],
.selectize-dropdown .optgroup-header {
padding: 3px 12px;
}
.selectize-dropdown .optgroup:first-child .optgroup-header {
border-top: 0 none;
}
.selectize-dropdown .optgroup-header {
color: #777777;
background: #ffffff;
cursor: default;
}
.selectize-dropdown .active {
background-color: #f5f5f5;
color: #262626;
}
.selectize-dropdown .active.create {
color: #262626;
}
.selectize-dropdown .create {
color: rgba(51, 51, 51, 0.5);
}
.selectize-dropdown-content {
overflow-y: auto;
overflow-x: hidden;
max-height: 200px;
}
.selectize-control.single .selectize-input,
.selectize-control.single .selectize-input input {
cursor: pointer;
}
.selectize-control.single .selectize-input.input-active,
.selectize-control.single .selectize-input.input-active input {
cursor: text;
}
.selectize-control.single .selectize-input:after {
content: ' ';
display: block;
position: absolute;
top: 50%;
right: 17px;
margin-top: -3px;
width: 0;
height: 0;
border-style: solid;
border-width: 5px 5px 0 5px;
border-color: #333333 transparent transparent transparent;
}
.selectize-control.single .selectize-input.dropdown-active:after {
margin-top: -4px;
border-width: 0 5px 5px 5px;
border-color: transparent transparent #333333 transparent;
}
.selectize-control.rtl.single .selectize-input:after {
left: 17px;
right: auto;
}
.selectize-control.rtl .selectize-input > input {
margin: 0 4px 0 -2px !important;
}
.selectize-control .selectize-input.disabled {
opacity: 0.5;
background-color: #ffffff;
}
.selectize-dropdown,
.selectize-dropdown.form-control {
height: auto;
padding: 0;
margin: 2px 0 0 0;
z-index: 1000;
background: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}
.selectize-dropdown .optgroup-header {
font-size: 12px;
line-height: 1.42857143;
}
.selectize-dropdown .optgroup:first-child:before {
display: none;
}
.selectize-dropdown .optgroup:before {
content: ' ';
display: block;
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
margin-left: -12px;
margin-right: -12px;
}
.selectize-dropdown-content {
padding: 5px 0;
}
.selectize-dropdown-header {
padding: 6px 12px;
}
.selectize-input {
min-height: 34px;
}
.selectize-input.dropdown-active {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.selectize-input.dropdown-active::before {
display: none;
}
.selectize-input.focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.has-error .selectize-input {
border-color: #a94442;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .selectize-input:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
}
.selectize-control.multi .selectize-input.has-items {
padding-left: 9px;
padding-right: 9px;
}
.selectize-control.multi .selectize-input > div {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.form-control.selectize-control {
padding: 0;
height: auto;
border: none;
background: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}

View File

@@ -0,0 +1,130 @@
.hfcm-form-width,
.widefat {
width: 100%;
}
.hfcm-list-width {
min-width: 10%
}
.hfcm-th-width {
width: 25%;
padding: 20px 20px 0 !important;
}
.hfcm-field-width,
.hfcm-form-width select,
.selectize-control {
width: 400px;
}
#nnr_newcontent {
width: 75%;
}
.nnr-btndelete {
color: #cc1818 !important;
box-shadow: inset 0 0 0 1px #cc1818 !important;
border: #cc1818 !important;
}
.nnr-btnsave, .nnr-btndelete, .nnr-btn-click-to-copy {
margin-top: 10px !important;
}
.nnr-btn-copy-inline {
text-decoration: underline !important;
margin-left: 10px;
}
.padding20 {
padding: 20px !important;
}
.nnr-padding10 {
padding: 10px !important;
}
/* toggle switch */
.round-toggle {
position: absolute;
margin-left: -9999px;
visibility: hidden;
}
.round-toggle + label {
display: inline-block;
position: relative;
cursor: pointer;
outline: none;
user-select: none;
vertical-align: middle;
}
input.round-toggle-round-flat + label {
padding: 2px;
width: 14px;
height: 5px;
color: #ddd;
border: 2px solid;
border-radius: 6px;
transition: color .3s;
}
input.round-toggle-round-flat + label:before,
input.round-toggle-round-flat + label:after {
display: block;
position: absolute;
content: '';
}
input.round-toggle-round-flat + label:after {
top: -2px;
left: -2px;
bottom: -2px;
width: 8px;
border: 2px solid;
border-radius: 6px;
background: #fff;
transition: margin .3s;
}
input.round-toggle-round-flat:checked + label:after {
margin-left: 10px;
}
.nnr-switch {
text-align: left;
white-space: nowrap;
}
.nnr-switch label {
cursor: pointer;
}
.nnr-switch label:hover {
color: #40B000;
}
.nnr-switch label:first-child:hover {
color: #ff2525;
}
input.round-toggle-round-flat:checked + label {
color: #4aaeee;
background: #4aaeee;
}
input.round-toggle-round-flat:checked + label:hover {
color: #ff2525;
}
.hfcm-red {
color: red
}
.nnr-wraptext {
width: -moz-available;
}
.nnr-hfcm-codeeditor-box .CodeMirror.CodeMirror-wrap {
height: 500px !important;
}
.nnr-mt-20 {
margin-top: 20px;
}
@media (max-width: 782px) {
.hfcm-form-width select {
min-width: auto;
}
#nnr_newcontent {
width: 103%;
width: calc(100% + 24px);
}
table.hfcm-form-width td {
padding: 10px 21px 0 17px;
}
table.hfcm-form-width tr:last-child td {
padding-bottom: 20px;
}
#wpbody .hfcm-form-width select[multiple] {
height: auto;
}
}

View File

@@ -0,0 +1,99 @@
.hfcm-review-stars{
text-decoration: none;
}
.hfcm-review-stars span{
font-size: 16px;
width: 16px;
height: 16px;
margin-top: 2px;
}
.hfcm-dismiss-alert{
position: static !important;
float: right;
top: 0 !important;
right: 0 !important;
padding: 0 15px 10px 28px !important;
margin-top: -10px !important;
font-size: 13px;
line-height: 1.23076923;
text-decoration: none;
}
.hfcm-dismiss-alert:before{
position: relative;
top: 18px;
left: -20px;
}
#hfcm-message{
position: relative;
}
.hfcm-meta-box-wrap.hfcm-grid .postbox {
float: left;
clear: left;
width: 50%;
margin: 0 0 16px;
}
.hfcm-meta-box-wrap.hfcm-grid .postbox:nth-child(even) {
float: right;
clear: right;
margin-right: -8px;
}
.hfcm-meta-box-wrap.hfcm-grid {
margin-left: 8px;
margin-right: 8px;
}
.hfcm-meta-box-wrap .postbox {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.hfcm-meta-box-wrap .postbox .hndle {
font-size: 14px;
padding: 8px 12px;
margin: 0;
line-height: 1.4;
position: relative;
z-index: 1;
cursor: default;
}
.hfcm-meta-box-wrap.hfcm-grid .postbox:nth-child(odd) {
margin-left: -8px;
}
.hfcm-meta-box-wrap.hfcm-grid .hfcm-notice {
margin: 5px 0 15px;
background: #fff;
border: 1px solid #c3c4c7;
border-left-width: 4px;
box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
padding: 1px 12px;
border-left-color: #dba617;
}
.hfcm-meta-box-wrap.hfcm-grid .hfcm-fields {
border: #ebebeb solid 1px;
background: #fafafa;
border-radius: 3px;
}
.hfcm-meta-box-wrap.hfcm-grid .hfcm-fields>.hfcm-field {
position: relative;
margin: 0;
padding: 15px 12px;
border-top: #EEEEEE solid 1px;
}
.hfcm-meta-box-wrap.hfcm-grid .hfcm-checkbox-list {
column-width: 200px;
}
.hfcm-meta-box-wrap.hfcm-grid .hfcm-label {
vertical-align: top;
margin: 0 0 10px;
}
.hfcm-meta-box-wrap.hfcm-grid .hfcm-label label {
font-weight: bold;
}
.hfcm-warning-notice {
padding: 10px;
}
.dashicons-hfcm {
background-repeat: no-repeat;
background-position: center;
background-size: 20px auto;
background-image: url("../images/99robots-logo-avatar.svg");
}

View File

@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352.1 398.9"><defs><style>.cls-1{fill:#f3f1f1;}</style></defs><title>gearAsset 1-black-01</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1-2"><path class="cls-1" d="M223.3,75.5c30,1.1,55.8,9.9,78.1,27.7,33,26.4,50.2,60.9,50.5,103.3.3,55.2.1,110.4.1,165.7V379h-5.4c-19,0-38-.1-57,.1a22.47,22.47,0,0,0-8.1,1.6c-22.5,9.1-46,13.9-70.1,16.4a348.46,348.46,0,0,1-72.2-.1c-23.5-2.5-46.6-7.2-68.6-16.3a22.06,22.06,0,0,0-7.7-1.6c-19-.1-38-.1-57-.1H0V207C.1,144.3,43.6,90.7,105,78.4c12.1-2.4,24.8-2.2,37.2-2.5,17.6-.4,35.3-.2,53,0,3.1,0,4.7-.9,5.9-3.8a88.83,88.83,0,0,1,19.6-29.2c2.1-2,2.4-3.7,1.7-6.5-3.5-16,5.6-31.3,20.8-35.3a29.54,29.54,0,0,1,36,19.7c3.4,11.1,1,21.1-7.1,29.4S253.9,61,242.8,57.8c-3.5-1-5.6-.5-7.6,2.2C231.5,64.8,227.8,69.6,223.3,75.5Zm96.4,270.6V340c0-43.2.1-86.5-.1-129.7A137.75,137.75,0,0,0,318,190c-7-46.6-47.8-81.9-95-82.1q-47.25-.15-94.4,0a85.18,85.18,0,0,0-12.4.9c-50,8.3-84.1,48.4-84.1,99.1V346.1Z"/><path class="cls-1" d="M230.4,260.6c-22.1,0-39.3-17.1-39.3-39.1a39,39,0,0,1,38.9-39h.1c22-.1,39.6,17.2,39.6,38.9C269.7,243.3,252.5,260.5,230.4,260.6Z"/><path class="cls-1" d="M118.4,260.6a38.86,38.86,0,0,1-39-38.7v-.8c.2-21.7,17.8-38.8,39.9-38.7a39.05,39.05,0,0,1,38.8,39.2h0A39,39,0,0,1,118.4,260.6Z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,612 @@
<?php
if ( !class_exists( 'WP_List_Table' ) ) {
include_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
class Hfcm_Snippets_List extends WP_List_Table
{
/**
* Class constructor
*/
public function __construct()
{
parent::__construct(
array(
'singular' => esc_html__( 'Snippet', 'header-footer-code-manager' ),
'plural' => esc_html__( 'Snippets', 'header-footer-code-manager' ),
'ajax' => false,
)
);
}
/**
* Retrieve snippets data from the database
*
* @param int $per_page
* @param int $page_number
*
* @return mixed
*/
public static function get_snippets( $per_page = 20, $page_number = 1, $customvar = 'all' )
{
global $wpdb;
$table_name = "{$wpdb->prefix}hfcm_scripts";
$page_number = absint( $page_number );
$per_page = absint( $per_page );
$customvar = sanitize_text_field( $customvar );
$orderby = 'script_id';
$order = 'ASC';
if ( !empty( $_GET['orderby'] ) ) {
$orderby = sanitize_sql_orderby( $_GET['orderby'] );
if ( empty( $orderby ) || !in_array( $orderby, array( 'script_id', 'name', 'location' ) ) ) {
$orderby = 'script_id';
}
}
if ( !empty( $_GET['order'] ) ) {
$order = strtolower( sanitize_sql_orderby( $_GET['order'] ) );
if ( empty( $order ) || !in_array( $order, array( 'desc', 'asc' ) ) ) {
$order = 'ASC';
}
}
$sql = "SELECT * FROM `{$table_name}` WHERE 1";
$placeholder_args = array();
if ( in_array( $customvar, array( 'inactive', 'active' ) ) ) {
$sql .= " AND status = '%s'";
$placeholder_args[] = $customvar;
}
if ( !empty( $_POST['snippet_type'] ) ) {
if ( check_admin_referer( 'bulk-snippets' ) ) {
$snippet_type = addslashes( sanitize_text_field( $_POST['snippet_type'] ) );
if ( in_array( $snippet_type, array( 'html', 'css', 'js' ) ) ) {
$sql .= " AND snippet_type = %s";
$placeholder_args[] = $snippet_type;
}
}
}
if ( !empty( $_POST['s'] ) ) {
if ( check_admin_referer( 'bulk-snippets' ) ) {
$search_query = addslashes( sanitize_text_field( $_POST['s'] ) );
$sql .= " AND name LIKE %s";
$placeholder_args[] = '%' . $search_query . '%';
}
}
$sql .= ' ORDER BY %s %s LIMIT %d OFFSET %d';
$placeholder_args[] = $orderby;
$placeholder_args[] = $order;
$placeholder_args[] = $per_page;
$placeholder_args[] = ($page_number - 1) * $per_page;
if ( !empty( $placeholder_args ) ) {
$sql = $wpdb->prepare( $sql, $placeholder_args );
}
$result = $wpdb->get_results(
$sql, 'ARRAY_A'
);
return $result;
}
/**
* Delete a snipppet record.
*
* @param int $id snippet ID
*/
public static function delete_snippet( $id )
{
$id = (int) $id;
if ( empty( $id ) ) {
return;
}
global $wpdb;
$table_name = "{$wpdb->prefix}hfcm_scripts";
$wpdb->delete(
$table_name, array( 'script_id' => $id ), array( '%d' )
);
}
/**
* Activate a snipppet record.
*
* @param int $id snippet ID
*/
public static function activate_snippet( $id )
{
$id = (int) $id;
if ( empty( $id ) ) {
return;
}
global $wpdb;
$table_name = "{$wpdb->prefix}hfcm_scripts";
$wpdb->update(
$table_name, array(
'status' => 'active',
), array( 'script_id' => $id ), array( '%s' ), array( '%d' )
);
}
/**
* Deactivate a snipppet record.
*
* @param int $id snippet ID
*/
public static function deactivate_snippet( $id )
{
$id = (int) $id;
if ( empty( $id ) ) {
return;
}
global $wpdb;
$table_name = "{$wpdb->prefix}hfcm_scripts";
$wpdb->update(
$table_name, array(
'status' => 'inactive',
), array( 'script_id' => $id ), array( '%s' ), array( '%d' )
);
}
/**
* Returns the count of records in the database.
*
* @return null|string
*/
public static function record_count( $customvar = 'all' )
{
global $wpdb;
$table_name = "{$wpdb->prefix}hfcm_scripts";
$sql = "SELECT COUNT(*) FROM `{$table_name}`";
$placeholder_args = [];
$customvar = sanitize_text_field( $customvar );
if ( in_array( $customvar, array( 'inactive', 'active' ) ) ) {
$sql .= " WHERE status = %s";
$placeholder_args[] = $customvar;
}
if ( !empty( $placeholder_args ) ) {
$sql = $wpdb->prepare( $sql, $placeholder_args );
}
return $wpdb->get_var( $sql );
}
/**
* Text displayed when no snippet data is available
*/
public function no_items()
{
esc_html_e( 'No Snippets available.', 'header-footer-code-manager' );
}
/**
* Render a column when no column specific method exist.
*
* @param array $item
* @param string $column_name
*
* @return mixed
*/
public function column_default( $item, $column_name )
{
switch ( $column_name ) {
case 'name':
return esc_html( $item[ $column_name ] );
case 'display_on':
$nnr_hfcm_display_array = array(
'All' => esc_html__( 'Site Wide', 'header-footer-code-manager' ),
's_posts' => esc_html__( 'Specific Posts', 'header-footer-code-manager' ),
's_pages' => esc_html__( 'Specific Pages', 'header-footer-code-manager' ),
's_categories' => esc_html__( 'Specific Categories', 'header-footer-code-manager' ),
's_custom_posts' => esc_html__( 'Specific Custom Post Types', 'header-footer-code-manager' ),
's_tags' => esc_html__( 'Specific Tags', 'header-footer-code-manager' ),
's_is_home' => esc_html__( 'Home Page', 'header-footer-code-manager' ),
's_is_search' => esc_html__( 'Search Page', 'header-footer-code-manager' ),
's_is_archive' => esc_html__( 'Archive Page', 'header-footer-code-manager' ),
'latest_posts' => esc_html__( 'Latest Posts', 'header-footer-code-manager' ),
'manual' => esc_html__( 'Shortcode Only', 'header-footer-code-manager' ),
);
if ( 's_posts' === $item[ $column_name ] ) {
$empty = 1;
$s_posts = json_decode( $item['s_posts'] );
foreach ( $s_posts as $id ) {
$id = absint( $id );
if ( 'publish' === get_post_status( $id ) ) {
$empty = 0;
break;
}
}
if ( $empty ) {
return '<span class="hfcm-red">' . esc_html__( 'No post selected', 'header-footer-code-manager' ) . '</span>';
}
}
return esc_html( $nnr_hfcm_display_array[ $item[ $column_name ] ] );
case 'location':
if ( !$item[ $column_name ] ) {
return esc_html__( 'N/A', 'header-footer-code-manager' );
}
$nnr_hfcm_locations = array(
'header' => esc_html__( 'Header', 'header-footer-code-manager' ),
'before_content' => esc_html__( 'Before Content', 'header-footer-code-manager' ),
'after_content' => esc_html__( 'After Content', 'header-footer-code-manager' ),
'footer' => esc_html__( 'Footer', 'header-footer-code-manager' ),
);
return esc_html( $nnr_hfcm_locations[ $item[ $column_name ] ] );
case 'device_type':
if ( 'both' === $item[ $column_name ] ) {
return esc_html__( 'Show on All Devices', 'header-footer-code-manager' );
} elseif ( 'mobile' === $item[ $column_name ] ) {
return esc_html__( 'Only Mobile Devices', 'header-footer-code-manager' );
} elseif ( 'desktop' === $item[ $column_name ] ) {
return esc_html__( 'Only Desktop', 'header-footer-code-manager' );
} else {
return esc_html( $item[ $column_name ] );
}
case 'snippet_type':
$snippet_types = array(
'html' => esc_html__( 'HTML', 'header-footer-code-manager' ),
'css' => esc_html__( 'CSS', 'header-footer-code-manager' ),
'js' => esc_html__( 'Javascript', 'header-footer-code-manager' )
);
return esc_html( $snippet_types[ $item[ $column_name ] ] );
case 'status':
if ( 'inactive' === $item[ $column_name ] ) {
return '<div class="nnr-switch">
<label for="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '">OFF</label>
<input id="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '" class="round-toggle round-toggle-round-flat" type="checkbox" data-id="' . esc_attr( $item['script_id'] ) . '" />
<label for="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '"></label>
<label for="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '">ON</label>
</div>
';
} elseif ( 'active' === $item[ $column_name ] ) {
return '<div class="nnr-switch">
<label for="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '">OFF</label>
<input id="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '" class="round-toggle round-toggle-round-flat" type="checkbox" data-id="' . esc_attr( $item['script_id'] ) . '" checked="checked" />
<label for="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '"></label>
<label for="nnr-round-toggle' . esc_attr( $item['script_id'] ) . '">ON</label>
</div>
';
} else {
return esc_html( $item[ $column_name ] );
}
case 'script_id':
return esc_html( $item[ $column_name ] );
case 'shortcode':
return '[hfcm id="' . absint( $item['script_id'] ) . '"]';
default:
return print_r( $item, true ); // Show the whole array for troubleshooting purposes
}
}
/**
* Render the bulk edit checkbox
*
* @param array $item
*
* @return string
*/
function column_cb( $item )
{
return sprintf(
'<input type="checkbox" name="snippets[]" value="%s" />', $item['script_id']
);
}
/**
* Method for name column
*
* @param array $item an array of DB data
*
* @return string
*/
function column_name( $item )
{
$delete_nonce = wp_create_nonce( 'hfcm_delete_snippet' );
$edit_nonce = wp_create_nonce( 'hfcm_edit_snippet' );
$title = '<strong>' . esc_html( $item['name'] ) . '</strong>';
$nnr_current_screen = get_current_screen();
if ( !empty( $nnr_current_screen->parent_base ) ) {
$page = $nnr_current_screen->parent_base;
} else {
$page = sanitize_text_field( $_GET['page'] );
}
$actions = array(
'edit' => sprintf( '<a href="?page=%s&action=%s&id=%s&_wpnonce=%s">' . esc_html__( 'Edit', 'header-footer-code-manager' ) . '</a>', esc_attr( 'hfcm-update' ), 'edit', absint( $item['script_id'] ), $edit_nonce ),
'copy' => sprintf( '<a href="javascript:void(0);" data-shortcode=\'[hfcm id="%s"]\' class="hfcm_copy_shortcode" id="hfcm_copy_shortcode_%s">' . esc_html__( 'Copy Shortcode', 'header-footer-code-manager' ) . '</a>', absint( $item['script_id'] ), absint( $item['script_id'] ) ),
'delete' => sprintf( '<a href="?page=%s&action=%s&snippet=%s&_wpnonce=%s">' . esc_html__( 'Delete', 'header-footer-code-manager' ) . '</a>', $page, 'delete', absint( $item['script_id'] ), $delete_nonce ),
);
return $title . $this->row_actions( $actions );
}
/**
* Associative array of columns
*
* @return array
*/
function get_columns()
{
$columns = array(
'cb' => '<input type="checkbox" />',
'script_id' => esc_html__( 'ID', 'header-footer-code-manager' ),
'status' => esc_html__( 'Status', 'header-footer-code-manager' ),
'name' => esc_html__( 'Snippet Name', 'header-footer-code-manager' ),
'display_on' => esc_html__( 'Display On', 'header-footer-code-manager' ),
'location' => esc_html__( 'Location', 'header-footer-code-manager' ),
'snippet_type' => esc_html__( 'Snippet Type', 'header-footer-code-manager' ),
'device_type' => esc_html__( 'Devices', 'header-footer-code-manager' ),
'shortcode' => esc_html__( 'Shortcode', 'header-footer-code-manager' ),
);
return $columns;
}
/**
* Columns to make sortable.
*
* @return array
*/
public function get_sortable_columns()
{
return array(
'name' => array( 'name', true ),
'location' => array( 'location', true ),
'script_id' => array( 'script_id', false ),
);
}
/**
* Returns an associative array containing the bulk action
*
* @return array
*/
public function get_bulk_actions()
{
return array(
'bulk-activate' => esc_html__( 'Activate', 'header-footer-code-manager' ),
'bulk-deactivate' => esc_html__( 'Deactivate', 'header-footer-code-manager' ),
'bulk-delete' => esc_html__( 'Remove', 'header-footer-code-manager' ),
);
}
/**
* Add filters and extra actions above and below the table
*
* @param string $which Are the actions displayed on the table top or bottom
*/
public function extra_tablenav( $which )
{
if ( 'top' === $which ) {
$query = isset( $_POST['snippet_type'] ) ? sanitize_text_field( $_POST['snippet_type'] ) : '';
$snippet_type = array(
'html' => esc_html__( 'HTML', 'header-footer-code-manager' ),
'css' => esc_html__( 'CSS', 'header-footer-code-manager' ),
'js' => esc_html__( 'Javascript', 'header-footer-code-manager' )
);
echo '<div class="alignleft actions">';
echo '<select name="snippet_type">';
echo '<option value="">' . esc_html__( 'All Snippet Types', 'header-footer-code-manager' ) . '</option>';
foreach ( $snippet_type as $key_type => $type ) {
if ( $key_type == $query ) {
echo '<option value="' . esc_attr( $key_type ) . '" selected>' . esc_html( $type ) . '</option>';
} else {
echo '<option value="' . esc_attr( $key_type ) . '">' . esc_html( $type ) . '</option>';
}
}
echo '</select>';
submit_button( __( 'Filter', 'header-footer-code-manager' ), 'button', 'filter_action', false );
echo '</div>';
}
echo '<div class="alignleft actions">';
echo '</div>';
}
/**
* Handles data query and filter, sorting, and pagination.
*/
public function prepare_items()
{
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
// Retrieve $customvar for use in query to get items.
$customvar = 'all';
if ( !empty( $_GET['customvar'] ) ) {
$customvar = sanitize_text_field( $_GET['customvar'] );
if ( empty( $customvar ) || !in_array( $customvar, [ 'inactive', 'active', 'all' ] ) ) {
$customvar = 'all';
}
}
$this->_column_headers = array( $columns, $hidden, $sortable );
/**
* Process bulk action
*/
$this->process_bulk_action();
$this->views();
$per_page = $this->get_items_per_page( 'snippets_per_page', 20 );
$current_page = $this->get_pagenum();
$total_items = self::record_count();
$this->set_pagination_args(
array(
'total_items' => $total_items,
'per_page' => $per_page,
)
);
$this->items = self::get_snippets( $per_page, $current_page, $customvar );
}
public function get_views()
{
$views = array();
$current = 'all';
if ( !empty( $_GET['customvar'] ) ) {
$current = sanitize_text_field( $_GET['customvar'] );
}
//All link
$class = 'all' === $current ? 'current' : '';
$all_url = remove_query_arg( 'customvar' );
$views['all'] = '<a href="' . esc_html( $all_url ) . '" class="' . esc_html( $class ) . '">' . esc_html__( 'All', 'header-footer-code-manager' ) . ' (' . esc_html__( $this->record_count() ) . ')</a>';
//Foo link
$foo_url = add_query_arg( 'customvar', 'active' );
$class = ('active' === $current ? 'current' : '');
$views['active'] = '<a href="' . esc_html( $foo_url ) . '" class="' . esc_html( $class ) . '">' . esc_html__( 'Active', 'header-footer-code-manager' ) . ' (' . esc_html__( $this->record_count( 'active' ) ) . ')</a>';
//Bar link
$bar_url = add_query_arg( 'customvar', 'inactive' );
$class = ('inactive' === $current ? 'current' : '');
$views['inactive'] = '<a href="' . esc_html( $bar_url ) . '" class="' . esc_html( $class ) . '">' . esc_html__( 'Inactive', 'header-footer-code-manager' ) . ' (' . esc_html__( $this->record_count( 'inactive' ) ) . ')</a>';
return $views;
}
public function process_bulk_action()
{
//Detect when a bulk action is being triggered...
if ( 'delete' === $this->current_action() ) {
if(!empty($_REQUEST['_wpnonce'])) {
// In our file that handles the request, verify the nonce.
$nonce = sanitize_text_field( $_REQUEST['_wpnonce'] );
if ( !wp_verify_nonce( $nonce, 'hfcm_delete_snippet' ) ) {
die( 'Go get a life script kiddies' );
} else {
if ( !empty( $_GET['snippet'] ) ) {
$snippet_id = absint( $_GET['snippet'] );
if ( !empty( $snippet_id ) ) {
self::delete_snippet( $snippet_id );
}
}
NNR_HFCM::hfcm_redirect( admin_url( 'admin.php?page=hfcm-list' ) );
return;
}
}
}
// If the delete bulk action is triggered
if ( (isset( $_POST['action'] ) && 'bulk-delete' === $_POST['action'])
|| (isset( $_POST['action2'] ) && 'bulk-delete' === $_POST['action2'])
) {
if ( check_admin_referer( 'bulk-snippets' ) ) {
$bulk_snippets = $_POST['snippets'];
// loop over the array of record IDs and delete them
foreach ( $bulk_snippets as $id ) {
$id = absint( $id );
if ( !empty( $id ) && is_int( $id ) ) {
self::delete_snippet( $id );
}
}
NNR_HFCM::hfcm_redirect( admin_url( 'admin.php?page=hfcm-list' ) );
return;
}
} elseif ( (isset( $_POST['action'] ) && 'bulk-activate' === $_POST['action'])
|| (isset( $_POST['action2'] ) && 'bulk-activate' === $_POST['action2'])
) {
if ( check_admin_referer( 'bulk-snippets' ) ) {
$bulk_snippets = $_POST['snippets'];
// loop over the array of record IDs and activate them
foreach ( $bulk_snippets as $id ) {
$id = absint( $id );
if ( !empty( $id ) && is_int( $id ) ) {
self::activate_snippet( $id );
}
}
NNR_HFCM::hfcm_redirect( admin_url( 'admin.php?page=hfcm-list' ) );
return;
}
} elseif ( (isset( $_POST['action'] ) && 'bulk-deactivate' === $_POST['action'])
|| (isset( $_POST['action2'] ) && 'bulk-deactivate' === $_POST['action2'])
) {
if ( check_admin_referer( 'bulk-snippets' ) ) {
$bulk_snippets = $_POST['snippets'];
// loop over the array of record IDs and deactivate them
foreach ( $bulk_snippets as $id ) {
$id = absint( $id );
if ( !empty( $id ) && is_int( $id ) ) {
self::deactivate_snippet( $id );
}
}
NNR_HFCM::hfcm_redirect( admin_url( 'admin.php?page=hfcm-list' ) );
return;
}
}
}
/**
* Displays the search box.
*
* @param string $text The 'submit' button label.
* @param string $input_id ID attribute value for the search input field.
* @since 3.1.0
*/
public function search_box( $text, $input_id )
{
if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) {
return;
}
$input_id = $input_id . '-search-input';
?>
<p class="search-box">
<label class="screen-reader-text"
for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $text ); ?>:</label>
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s"
value="<?php esc_attr( _admin_search_query() ); ?>"/>
<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
</p>
<?php
}
}

View File

@@ -0,0 +1,460 @@
<?php
// Register the script
wp_register_script( 'hfcm_showboxes', plugins_url( 'js/nnr-hfcm-showboxes.js', dirname( __FILE__ ) ), array( 'jquery' ) );
// prepare ID (for AJAX)
if ( !isset( $id ) ) {
$id = -1;
}
// Localize the script with new data
$translation_array = array(
'header' => __( 'Header', 'header-footer-code-manager' ),
'before_content' => __( 'Before Content', 'header-footer-code-manager' ),
'after_content' => __( 'After Content', 'header-footer-code-manager' ),
'footer' => __( 'Footer', 'header-footer-code-manager' ),
'id' => absint( $id ),
'security' => wp_create_nonce( 'hfcm-get-posts' ),
);
wp_localize_script( 'hfcm_showboxes', 'hfcm_localize', $translation_array );
// Enqueued script with localized data.
wp_enqueue_script( 'hfcm_showboxes' );
?>
<div class="wrap">
<h1>
<?php echo $update ? esc_html__( 'Edit Snippet', 'header-footer-code-manager' ) : esc_html__( 'Add New Snippet', 'header-footer-code-manager' ) ?>
<?php if ( $update ) : ?>
<a href="<?php echo admin_url( 'admin.php?page=hfcm-create' ) ?>" class="page-title-action">
<?php esc_html_e( 'Add New Snippet', 'header-footer-code-manager' ) ?>
</a>
<?php endif; ?>
</h1>
<?php
if ( !empty( $_GET['message'] ) ) :
if ( 1 === $_GET['message'] ) :
?>
<div class="updated">
<p><?php esc_html_e( 'Script updated', 'header-footer-code-manager' ); ?></p>
</div>
<a href="<?php echo admin_url( 'admin.php?page=hfcm-list' ) ?>">&laquo; <?php esc_html_e( 'Back to list', 'header-footer-code-manager' ); ?></a>
<?php elseif ( 6 === $_GET['message'] ) : ?>
<div class="updated">
<p><?php esc_html_e( 'Script Added Successfully', 'header-footer-code-manager' ); ?></p>
</div>
<a href="<?php echo admin_url( 'admin.php?page=hfcm-list' ) ?>">&laquo; <?php esc_html_e( 'Back to list', 'header-footer-code-manager' ); ?></a>
<?php
endif;
endif;
if ( $update ) :
$hfcm_form_action = admin_url( 'admin.php?page=hfcm-request-handler&id=' . absint( $id ) );
else :
$hfcm_form_action = admin_url( 'admin.php?page=hfcm-request-handler' );
endif;
?>
<form method="post" action="<?php echo $hfcm_form_action ?>">
<?php
if ( $update ) :
wp_nonce_field( 'update-snippet_' . absint( $id ) );
else :
wp_nonce_field( 'create-snippet' );
endif;
?>
<table class="wp-list-table widefat fixed hfcm-form-width form-table">
<tr>
<th class="hfcm-th-width"><?php esc_html_e( 'Snippet Name', 'header-footer-code-manager' ); ?></th>
<td>
<input type="text" name="data[name]" value="<?php echo esc_attr( $name ); ?>"
class="hfcm-field-width"/>
</td>
</tr>
<?php
$nnr_hfcm_snippet_type_array = array(
'html' => esc_html__( 'HTML', 'header-footer-code-manager' ),
'css' => esc_html__( 'CSS', 'header-footer-code-manager' ),
'js' => esc_html__( 'Javascript', 'header-footer-code-manager' )
); ?>
<tr id="snippet_type">
<th class="hfcm-th-width">
<?php esc_html_e( 'Snippet Type', 'header-footer-code-manager' ); ?>
</th>
<td>
<select name="data[snippet_type]">
<?php
foreach ( $nnr_hfcm_snippet_type_array as $nnr_key => $nnr_item ) {
if ( $nnr_key === $nnr_snippet_type ) {
echo "<option value='" . esc_attr( $nnr_key ) . "' selected>" . esc_html( $nnr_item ) . "</option>";
} else {
echo "<option value='" . esc_attr( $nnr_key ) . "'>" . esc_html( $nnr_item ) . "</option>";
}
}
?>
</select>
</td>
</tr>
<?php
$nnr_hfcm_display_array = array(
'All' => esc_html__( 'Site Wide', 'header-footer-code-manager' ),
's_posts' => esc_html__( 'Specific Posts', 'header-footer-code-manager' ),
's_pages' => esc_html__( 'Specific Pages', 'header-footer-code-manager' ),
's_categories' => esc_html__( 'Specific Categories (Archive & Posts)', 'header-footer-code-manager' ),
's_custom_posts' => esc_html__( 'Specific Post Types (Archive & Posts)', 'header-footer-code-manager' ),
's_tags' => esc_html__( 'Specific Tags (Archive & Posts)', 'header-footer-code-manager' ),
's_is_home' => esc_html__( 'Home Page', 'header-footer-code-manager' ),
's_is_search' => esc_html__( 'Search Page', 'header-footer-code-manager' ),
's_is_archive' => esc_html__( 'Archive Page', 'header-footer-code-manager' ),
'latest_posts' => esc_html__( 'Latest Posts', 'header-footer-code-manager' ),
'manual' => esc_html__( 'Shortcode Only', 'header-footer-code-manager' ),
); ?>
<tr>
<th class="hfcm-th-width"><?php esc_html_e( 'Site Display', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[display_on]" onchange="hfcm_showotherboxes(this.value);">
<?php
foreach ( $nnr_hfcm_display_array as $dkey => $statusv ) {
if ( $display_on === $dkey ) {
printf( '<option value="%1$s" selected="selected">%2$s</option>', $dkey, $statusv );
} else {
printf( '<option value="%1$s">%2$s</option>', $dkey, $statusv );
}
}
?>
</select>
</td>
</tr>
<?php
$nnr_hfcm_pages = get_pages();
$nnr_hfcm_exclude_pages_style = ('s_pages' === $display_on) ? 'display:none;' : '';
$nnr_hfcm_exclude_posts_style = ('s_posts' === $display_on) ? 'display:none;' : '';
$nnr_hfcm_exclude_categories_style = 's_categories' === $display_on ? 'display:none;' : '';
$nnr_hfcm_exclude_tags_style = 's_tags' === $display_on ? 'display:none;' : '';
$nnr_hfcm_exclude_custom_posts_style = 's_custom_posts' === $display_on ? 'display:none;' : '';
$nnr_hfcm_exclude_lp_count_style = 'latest_posts' === $display_on ? 'display:none;' : '';
$nnr_hfcm_exclude_manual_style = 'manual' === $display_on ? 'display:none;' : '';
?>
<tr id="ex_pages"
style="<?php echo esc_attr( $nnr_hfcm_exclude_pages_style . $nnr_hfcm_exclude_posts_style . $nnr_hfcm_exclude_tags_style . $nnr_hfcm_exclude_custom_posts_style . $nnr_hfcm_exclude_categories_style . $nnr_hfcm_exclude_lp_count_style . $nnr_hfcm_exclude_manual_style ); ?>">
<th class="hfcm-th-width"><?php esc_html_e( 'Exclude Pages', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[ex_pages][]" multiple>
<?php
foreach ( $nnr_hfcm_pages as $pdata ) {
if ( in_array( $pdata->ID, $ex_pages ) ) {
printf( '<option value="%1$s" selected="selected">%2$s</option>', $pdata->ID, $pdata->post_title );
} else {
printf( '<option value="%1$s">%2$s</option>', $pdata->ID, $pdata->post_title );
}
}
?>
</select>
</td>
</tr>
<tr id="ex_posts"
style="<?php echo esc_attr( $nnr_hfcm_exclude_pages_style . $nnr_hfcm_exclude_posts_style . $nnr_hfcm_exclude_tags_style . $nnr_hfcm_exclude_custom_posts_style . $nnr_hfcm_exclude_categories_style . $nnr_hfcm_exclude_lp_count_style . $nnr_hfcm_exclude_manual_style ); ?>">
<th class="hfcm-th-width"><?php esc_html_e( 'Exclude Posts', 'header-footer-code-manager' ); ?></th>
<td>
<select class="nnr-wraptext" name="data[ex_posts][]" multiple>
<option disabled></option>
</select> <img id="loader"
src="<?php echo plugins_url( 'images/ajax-loader.gif', dirname( __FILE__ ) ); ?>">
</td>
</tr>
<?php
$nnr_hfcm_pages = get_pages();
$nnr_hfcm_pages_style = ('s_pages' === $display_on) ? '' : 'display:none;';
?>
<tr id="s_pages" style="<?php echo esc_attr( $nnr_hfcm_pages_style ); ?>">
<th class="hfcm-th-width">
<?php esc_html_e( 'Page List', 'header-footer-code-manager' ); ?>
</th>
<td>
<select name="data[s_pages][]" multiple>
<?php
foreach ( $nnr_hfcm_pages as $pdata ) {
if ( in_array( $pdata->ID, $s_pages ) ) {
printf( '<option value="%1$s" selected="selected">%2$s</option>', esc_attr( $pdata->ID ), esc_attr( $pdata->post_title ) );
} else {
printf( '<option value="%1$s">%2$s</option>', esc_attr( $pdata->ID ), esc_attr( $pdata->post_title ) );
}
}
?>
</select>
</td>
</tr>
<?php $nnr_hfcm_posts_style = 's_posts' === $display_on ? '' : 'display:none;'; ?>
<tr id="s_posts" style="<?php echo esc_attr( $nnr_hfcm_posts_style ); ?>">
<th class="hfcm-th-width">
<?php esc_html_e( 'Post List', 'header-footer-code-manager' ); ?>
</th>
<td>
<select class="nnr-wraptext" name="data[s_posts][]" multiple>
<option disabled>...</option>
</select>
</td>
</tr>
<?php
$nnr_hfcm_categories = NNR_HFCM::hfcm_get_categories();
$nnr_hfcm_tags = NNR_HFCM::hfcm_get_tags();
$nnr_hfcm_categories_style = 's_categories' === $display_on ? '' : 'display:none;';
$nnr_hfcm_tags_style = 's_tags' === $display_on ? '' : 'display:none;';
$nnr_hfcm_custom_posts_style = 's_custom_posts' === $display_on ? '' : 'display:none;';
$nnr_hfcm_lpcount_style = 'latest_posts' === $display_on ? '' : 'display:none;';
$nnr_hfcm_location_style = 'manual' === $display_on ? 'display:none;' : '';
// Get all names of Post Types
$args = array(
'public' => true,
);
$output = 'names';
$operator = 'and';
$nnr_hfcm_custom_post_types = get_post_types( $args, $output, $operator );
$nnr_hfcm_post_types = array( 'post' );
foreach ( $nnr_hfcm_custom_post_types as $cpdata ) {
$nnr_hfcm_post_types[] = $cpdata;
}
?>
<tr id="s_categories" style="<?php echo esc_attr( $nnr_hfcm_categories_style ); ?>">
<th class="hfcm-th-width"><?php esc_html_e( 'Category List', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[s_categories][]" multiple>
<?php
foreach ( $nnr_hfcm_categories as $nnr_key_cat => $nnr_item_cat ) {
foreach ( $nnr_item_cat['terms'] as $nnr_item_cat_key => $nnr_item_cat_term ) {
if ( in_array( $nnr_item_cat_term->term_id, $s_categories ) ) {
echo "<option value='" . esc_attr( $nnr_item_cat_term->term_id ) . "' selected>" . esc_html( $nnr_item_cat['name'] ) . " - " . esc_html( $nnr_item_cat_term->name ) . "</option>";
} else {
echo "<option value='" . esc_attr( $nnr_item_cat_term->term_id ) . "'>" . esc_html( $nnr_item_cat['name'] ) . " - " . esc_html( $nnr_item_cat_term->name ) . "</option>";
}
}
}
?>
</select>
</td>
</tr>
<tr id="s_tags" style="<?php echo esc_attr( $nnr_hfcm_tags_style ); ?>">
<th class="hfcm-th-width"><?php esc_html_e( 'Tags List', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[s_tags][]" multiple>
<?php
foreach ( $nnr_hfcm_tags as $nnr_key_cat => $nnr_item_tag ) {
foreach ( $nnr_item_tag['terms'] as $nnr_item_tag_key => $nnr_item_tag_term ) {
if ( in_array( $nnr_item_tag_term->term_id, $s_tags ) ) {
echo "<option value='" . esc_attr( $nnr_item_tag_term->term_id ) . "' selected>" . esc_html( $nnr_item_tag['name'] ) . " - " . esc_html( $nnr_item_tag_term->name ) . "</option>";
} else {
echo "<option value='" . esc_attr( $nnr_item_tag_term->term_id ) . "'>" . esc_html( $nnr_item_tag['name'] ) . " - " . esc_html( $nnr_item_tag_term->name ) . "</option>";
}
}
}
?>
</select>
</td>
</tr>
<tr id="c_posttype" style="<?php echo esc_attr( $nnr_hfcm_custom_posts_style ); ?>">
<th class="hfcm-th-width"><?php esc_html_e( 'Post Types', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[s_custom_posts][]" multiple>
<?php
foreach ( $nnr_hfcm_custom_post_types as $cpkey => $cpdata ) {
if ( in_array( $cpkey, $s_custom_posts ) ) {
echo "<option value='" . esc_attr( $cpkey ) . "' selected>" . esc_html( $cpdata ) . "</option>";
} else {
echo "<option value='" . esc_attr( $cpkey ) . "'>" . esc_html( $cpdata ) . "</option>";
}
}
?>
</select>
</td>
</tr>
<tr id="lp_count" style="<?php echo esc_attr( $nnr_hfcm_lpcount_style ); ?>">
<th class="hfcm-th-width"><?php esc_html_e( 'Post Count', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[lp_count]">
<?php
for ( $i = 1; $i <= 20; $i++ ) {
if ( $i == $lp_count ) {
echo "<option value='" . esc_attr( $i ) . "' selected>" . esc_html( $i ) . "</option>";
} else {
echo "<option value='" . esc_attr( $i ) . "'>" . esc_html( $i ) . "</option>";
}
}
?>
</select>
</td>
</tr>
<?php
if ( in_array( $display_on, array( 's_posts', 's_pages', 's_custom_posts', 's_tags',
'latest_posts' ) ) ) {
$nnr_hfcm_locations = array(
'header' => __( 'Header', 'header-footer-code-manager' ),
'before_content' => __( 'Before Content', 'header-footer-code-manager' ),
'after_content' => __( 'After Content', 'header-footer-code-manager' ),
'footer' => __( 'Footer', 'header-footer-code-manager' )
);
} else {
$nnr_hfcm_locations = array(
'header' => __( 'Header', 'header-footer-code-manager' ),
'footer' => __( 'Footer', 'header-footer-code-manager' )
);
}
?>
<tr id="locationtr" style="<?php echo esc_attr( $nnr_hfcm_location_style ); ?>">
<th class="hfcm-th-width">
<?php esc_html_e( 'Location', 'header-footer-code-manager' ); ?>
</th>
<td>
<select name="data[location]" id="data_location">
<?php
foreach ( $nnr_hfcm_locations as $lkey => $statusv ) {
if ( $location === $lkey ) {
echo "<option value='" . esc_attr( $lkey ) . "' selected='selected'>" . esc_html( $statusv ) . '</option>';
} else {
echo "<option value='" . esc_attr( $lkey ) . "'>" . esc_html( $statusv ) . '</option>';
}
}
?>
</select>
<p>
<b><?php _e( "Note", 'header-footer-code-manager' ); ?></b>: <?php _e( "Not all locations (such as before content) exist on all page/post types. The location will only appear as an option if the appropriate hook exists on the page.", 'header-footer-code-manager' ); ?>
</p>
</td>
</tr>
<?php $nnr_hfcm_device_type_array = array(
'both' => __( 'Show on All Devices', 'header-footer-code-manager' ),
'desktop' => __( 'Only Desktop', 'header-footer-code-manager' ),
'mobile' => __( 'Only Mobile Devices', 'header-footer-code-manager' )
) ?>
<?php $nnr_hfcm_status_array = array(
'active' => __( 'Active', 'header-footer-code-manager' ),
'inactive' => __( 'Inactive', 'header-footer-code-manager' )
) ?>
<tr>
<th class="hfcm-th-width"><?php esc_html_e( 'Device Display', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[device_type]">
<?php
foreach ( $nnr_hfcm_device_type_array as $smkey => $typev ) {
if ( $device_type === $smkey ) {
echo "<option value='" . esc_attr( $smkey ) . "' selected='selected'>" . esc_html( $typev ) . '</option>';
} else {
echo "<option value='" . esc_attr( $smkey ) . "'>" . esc_html( $typev ) . '</option>';
}
}
?>
</select>
</td>
</tr>
<tr>
<th class="hfcm-th-width"><?php esc_html_e( 'Status', 'header-footer-code-manager' ); ?></th>
<td>
<select name="data[status]">
<?php
foreach ( $nnr_hfcm_status_array as $skey => $statusv ) {
if ( $status === $skey ) {
echo "<option value='" . esc_attr( $skey ) . "' selected='selected'>" . esc_html( $statusv ) . '</option>';
} else {
echo "<option value='" . esc_attr( $skey ) . "'>" . esc_html( $statusv ) . '</option>';
}
}
?>
</select>
</td>
</tr>
<?php if ( $update ) : ?>
<tr>
<th class="hfcm-th-width"><?php esc_html_e( 'Shortcode', 'header-footer-code-manager' ); ?></th>
<td>
<p>
[hfcm id="<?php echo esc_html( $id ); ?>"]
<?php if ( $update ) :
?>
<a data-shortcode='[hfcm id="<?php echo absint( $id ); ?>"]'
href="javascript:void(0);" class="nnr-btn-click-to-copy nnr-btn-copy-inline"
id="hfcm_copy_shortcode">
<?php esc_html_e( 'Copy', 'header-footer-code-manager' ); ?>
</a>
<?php endif; ?>
</p>
</td>
</tr>
<tr>
<th class="hfcm-th-width">
<?php esc_html_e( 'Changelog', 'header-footer-code-manager' ); ?>
</th>
<td>
<p>
<?php esc_html_e( 'Snippet created by', 'header-footer-code-manager' ); ?>
<b><?php echo esc_html( $createdby ); ?></b> <?php echo _e( 'on', 'header-footer-code-manager' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $createdon ) ) . ' ' . __( 'at', 'header-footer-code-manager' ) . ' ' . date_i18n( get_option( 'time_format' ), strtotime( $createdon ) ) ?>
<br/>
<?php if ( !empty( $lastmodifiedby ) ) : ?>
<?php esc_html_e( 'Last edited by', 'header-footer-code-manager' ); ?>
<b><?php echo esc_html( $lastmodifiedby ); ?></b> <?php echo _e( 'on', 'header-footer-code-manager' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $lastrevisiondate ) ) . ' ' . __( 'at', 'header-footer-code-manager' ) . ' ' . date_i18n( get_option( 'time_format' ), strtotime( $lastrevisiondate ) ) ?>
<?php endif; ?>
</p>
</td>
</tr>
<?php endif; ?>
</table>
<div class="nnr-mt-20">
<h1><?php esc_html_e( 'Snippet', 'header-footer-code-manager' ); ?>
/ <?php esc_html_e( 'Code', 'header-footer-code-manager' ) ?></h1>
<div class="nnr-mt-20 nnr-hfcm-codeeditor-box">
<textarea name="data[snippet]" aria-describedby="nnr-newcontent-description" id="nnr_newcontent"
rows="20"><?php echo html_entity_decode( $snippet ); ?></textarea>
<p class="notice notice-warning nnr-padding10" id="nnr-snippet-warning">
<?php _e( 'Warning: Using improper code or untrusted sources code can break your site or create security risks. <a href="https://draftpress.com/security-risks-of-wp-plugins-that-allow-code-editing-or-insertion" target="_blank">Learn more</a>.', 'header-footer-code-manager' ); ?>
</p>
<div class="wp-core-ui">
<input type="submit"
name="<?php echo $update ? 'update' : 'insert'; ?>"
value="<?php echo $update ? esc_html__( 'Update', 'header-footer-code-manager' ) : esc_html__( 'Save', 'header-footer-code-manager' ) ?>"
class="button button-primary button-large nnr-btnsave">
<?php if ( $update ) :
$delete_nonce = wp_create_nonce( 'hfcm_delete_snippet' );
?>
<a onclick="return nnr_confirm_delete_snippet();"
href="<?php echo esc_url( admin_url( 'admin.php?page=hfcm-list&action=delete&_wpnonce=' . $delete_nonce . '&snippet=' . absint( $id ) ) ); ?>"
class="button button-secondary button-large nnr-btndelete"><?php esc_html_e( 'Delete', 'header-footer-code-manager' ); ?></a>
<?php endif; ?>
</div>
</div>
</div>
</form>
</div>
<?php
if (defined( 'DISALLOW_FILE_EDIT' ) && true === DISALLOW_FILE_EDIT && !get_user_meta(get_current_user_id(),'hfcm_file_edit_plugin_notice_dismissed', true) ) {
?>
<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js">
<div class="notification-dialog-background"></div>
<div class="notification-dialog">
<div class="file-editor-warning-content">
<div class="file-editor-warning-message">
<h1>Heads up!</h1>
<p>
<?php _e('Your site has <a href="https://draftpress.com/disallow-file-edit-setting-wordpress" target="_blank">disallow_file_edit</a> setting enabled inside the wp-config file to prevent file edits. By using this plugin, you acknowledge that you know what youre doing and intend on adding code snippets only from trusted sources.', 'header-footer-code-manager'); ?>
</p>
</div>
<p>
<?php
if ( $update ) :
$hfcm_file_edit_dismiss_action = admin_url( 'admin.php?page=hfcm-update&hfcm-file-edit-notice-dismissed=1&id=' . absint( $id ) );
else :
$hfcm_file_edit_dismiss_action = admin_url( 'admin.php?page=hfcm-create&hfcm-file-edit-notice-dismissed=1' );
endif;
?>
<a href="<?php echo $hfcm_file_edit_dismiss_action; ?>" class="file-editor-warning-dismiss button button-primary" id="nnr-dismiss-editor-warning">I understand</a>
</p>
</div>
</div>
</div>
<?php
}
?>

View File

@@ -0,0 +1,125 @@
<?php
// Register the script
wp_register_script('hfcm_showboxes', plugins_url('js/nnr-hfcm-showboxes.js', dirname(__FILE__)), array( 'jquery' ));
// Localize the script with new data
$translation_array = array(
'header' => __('Header', 'header-footer-code-manager'),
'before_content' => __('Before Content', 'header-footer-code-manager'),
'after_content' => __('After Content', 'header-footer-code-manager'),
'footer' => __('Footer', 'header-footer-code-manager'),
'security' => wp_create_nonce('hfcm-get-posts'),
);
wp_localize_script('hfcm_showboxes', 'hfcm_localize', $translation_array);
// Enqueued script with localized data.
wp_enqueue_script('hfcm_showboxes');
?>
<div class="wrap">
<h1>
<?php _e('Tools', 'header-footer-code-manager'); ?>
</h1>
<div class="hfcm-meta-box-wrap hfcm-grid">
<div id="normal-sortables" class="meta-box-sortables">
<div id="hfcm-admin-tool-export" class="postbox ">
<div class="postbox-header">
<h2 class="hndle">
<?php _e('Export Snippets', 'header-footer-code-manager'); ?>
</h2>
</div>
<div class="inside">
<form method="post">
<p>
<?php _e(
'Select the snippets you would like to export and then select your export method. Use the
download button to export to a .json file which you can then import to another HFCM
installation', 'header-footer-code-manager'
); ?>.
</p>
<div class="hfcm-notice notice-warning">
<p><?php _e('NOTE: Import/Export Functionality is only intended to operate within the same website. Using the export/import to move snippets from one website to a different site, may result in inconsistent behavior, particularly if you have specific elements as criteria such as pages, posts, categories, or tags.', 'header-footer-code-manager'); ?></p>
</div>
<div class="hfcm-fields">
<div class="hfcm-field hfcm-field-checkbox" data-name="keys" data-type="checkbox">
<div class="hfcm-label">
<label for="keys">
<?php _e('Select Snippets', 'header-footer-code-manager'); ?>
</label>
</div>
<div class="hfcm-input">
<input type="hidden" name="keys">
<ul class="hfcm-checkbox-list hfcm-bl">
<?php if (!empty($nnr_hfcm_snippets) ) {
foreach ( $nnr_hfcm_snippets as $nnr_key => $nnr_hfcm_snippet ) {
?>
<li>
<label>
<input type="checkbox"
id="keys-snippet_<?php echo absint($nnr_hfcm_snippet->script_id); ?>"
name="nnr_hfcm_snippets[]"
value="snippet_<?php echo absint($nnr_hfcm_snippet->script_id); ?>"> <?php echo esc_html($nnr_hfcm_snippet->name); ?>
</label>
</li>
<?php
}
} ?>
</ul>
</div>
</div>
</div>
<p class="hfcm-submit">
<button type="submit" name="action" class="button button-primary" value="download">
<?php _e('Export File', 'header-footer-code-manager'); ?>
</button>
</p>
<?php wp_nonce_field('hfcm-nonce'); ?>
</form>
</div>
</div>
<div id="hfcm-admin-tool-import" class="postbox ">
<div class="postbox-header">
<h2 class="hndle">
<?php _e('Import Snippets', 'header-footer-code-manager'); ?>
</h2>
</div>
<div class="inside">
<form method="post" enctype="multipart/form-data">
<p>
<?php _e(
'Select the HFCM JSON file you would like to import. When you click the import button below,
HFCM will import the field groups.', 'header-footer-code-manager'
); ?>
</p>
<div class="hfcm-fields">
<div class="hfcm-field hfcm-field-file" data-name="hfcm_import_file" data-type="file">
<div class="hfcm-label">
<label for="hfcm_import_file">
<?php _e('Select File', 'header-footer-code-manager'); ?>
</label>
</div>
<div class="hfcm-input">
<div class="hfcm-file-uploader" data-library="all" data-mime_types=""
data-uploader="basic">
<div class="hide-if-value">
<label class="hfcm-basic-uploader">
<input type="file" name="nnr_hfcm_import_file"
id="nnr_hfcm_import_file">
</label>
</div>
</div>
</div>
</div>
</div>
<p class="hfcm-submit">
<input type="submit" class="button button-primary" value="<?php echo __('Import', 'header-footer-code-manager');?>">
</p>
<?php wp_nonce_field('hfcm-nonce'); ?>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,5 @@
// simple redirect
if ('undefined' == typeof hfcm_location ) {
var hfcm_location = {url:''};
}
window.location.replace(hfcm_location.url);

View File

@@ -0,0 +1,174 @@
// function to show dependent dropdowns for "Site Display" field.
function hfcm_showotherboxes(type)
{
var header = '<option value="header">' + hfcm_localize.header + '</option>',
before_content = '<option value="before_content">' + hfcm_localize.before_content + '</option>',
after_content = '<option value="after_content">' + hfcm_localize.after_content + '</option>',
footer = '<option value="footer">' + hfcm_localize.footer + '</option>',
all_options = header + before_content + after_content + footer;
if (type == 'All') {
jQuery('#ex_pages, #ex_posts, #locationtr').show();
hfcm_remember_loc(header + footer);
jQuery('#s_categories, #s_pages, #s_tags, #c_posttype, #lp_count, #s_posts').hide();
} else if (type == 's_pages') {
jQuery('#s_pages, #locationtr').show();
hfcm_remember_loc(all_options);
jQuery('#s_categories, #s_tags, #ex_pages, #ex_posts, #c_posttype, #lp_count, #s_posts').hide();
} else if (type == 's_posts') {
jQuery('#s_posts, #locationtr').show();
hfcm_remember_loc(all_options);
jQuery('#s_pages, #s_categories, #ex_pages, #ex_posts, #s_tags, #c_posttype, #lp_count').hide();
} else if (type == 's_categories') {
jQuery('#s_categories, #locationtr').show();
hfcm_remember_loc(all_options);
jQuery('#s_pages, #s_tags, #c_posttype, #ex_pages, #ex_posts, #lp_count, #s_posts').hide();
} else if (type == 's_custom_posts') {
jQuery('#c_posttype, #locationtr').show();
hfcm_remember_loc(all_options);
jQuery('#s_categories, #s_tags, #s_pages, #ex_pages, #ex_posts, #lp_count, #s_posts').hide();
} else if (type == 's_tags') {
hfcm_remember_loc(all_options);
jQuery('#s_tags, #locationtr').show();
jQuery('#s_categories, #s_pages, #c_posttype, #ex_pages, #ex_posts, #lp_count, #s_posts').hide();
} else if (type == 'latest_posts') {
hfcm_remember_loc(all_options);
jQuery('#s_pages, #s_categories, #s_tags, #ex_pages, #ex_posts, #c_posttype, #s_posts').hide();
jQuery('#lp_count, #locationtr').show();
} else if (type == 'manual') {
jQuery('#s_pages, #s_categories, #s_tags,#ex_pages, #ex_posts, #c_posttype, #lp_count, #locationtr, #s_posts').hide();
} else {
hfcm_remember_loc(header + footer);
jQuery('#s_pages, #s_categories, #s_tags, #c_posttype, #lp_count, #s_posts').hide();
jQuery('#locationtr').show();
}
}
function hfcm_remember_loc(new_html)
{
var tmp = jQuery('#data_location option:selected').val();
jQuery('#data_location').html(new_html);
jQuery('#data_location option[value="' + tmp + '"]').prop('selected', true);
}
function hfcmCopyToClipboard(elem)
{
// create hidden text element, if it doesn't already exist
var targetId = "_hiddenCopyText_";
var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
var origSelectionStart, origSelectionEnd;
// must use a temporary form element for the selection and copy
target = document.getElementById(targetId);
if (!target) {
var target = document.createElement("textarea");
target.style.position = "absolute";
target.style.left = "-9999px";
target.style.top = "0";
target.id = targetId;
document.body.appendChild(target);
}
target.textContent = elem.getAttribute('data-shortcode');
elem.textContent = "Copied!";
setTimeout(
function () {
elem.textContent = "Copy";
}, 2000
);
// select the content
var currentFocus = document.activeElement;
target.focus();
target.setSelectionRange(0, target.value.length);
// copy the selection
var succeed;
try {
succeed = document.execCommand("copy");
} catch (e) {
succeed = false;
}
// restore original focus
if (currentFocus && typeof currentFocus.focus === "function") {
currentFocus.focus();
}
if (isInput) {
// restore prior selection
elem.setSelectionRange(origSelectionStart, origSelectionEnd);
} else {
// clear temporary content
target.textContent = "";
}
target.remove();
return succeed;
}
function nnr_confirm_delete_snippet()
{
return confirm("Are you sure you want to delete this snippet?");
}
// init selectize.js
jQuery('#loader').show();
jQuery(
function ($) {
var nnr_hfcm_data = {
action: 'hfcm-request',
id: hfcm_localize.id,
get_posts: true,
security: hfcm_localize.security
};
$.post(
ajaxurl,
nnr_hfcm_data,
function (new_data) {
var all_posts = $.merge([{text: "", value:""}], new_data.posts);
var options = {
plugins: ['remove_button'],
options: all_posts,
items: new_data.selected
};
$('#loader').hide();
$('#s_posts select').selectize(options);
var options = {
plugins: ['remove_button'],
options: new_data.posts,
items: new_data.excluded
};
$('#loader').hide();
$('#ex_posts select').selectize(options);
},
'json', // ajax result format
);
// selectize all <select multiple> elements
$('#s_pages select, #s_categories select, #c_posttype select, #s_tags select, #ex_pages select').selectize(
{
plugins: ['remove_button']
}
);
if ($('#nnr_newcontent').length) {
var editorSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {};
editorSettings.codemirror = _.extend(
{},
editorSettings.codemirror,
{
indentUnit: 2,
tabSize: 2,
//mode: 'javascript',
}
);
var editor = wp.codeEditor.initialize($('#nnr_newcontent'), editorSettings);
}
document.getElementById("hfcm_copy_shortcode").addEventListener(
"click", function () {
hfcmCopyToClipboard(document.getElementById("hfcm_copy_shortcode"));
}
);
}
);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,95 @@
// Toggle switch
jQuery('.nnr-switch input').on(
'click', function () {
var t = jQuery(this),
togvalue = t.is(':checked') ? 'on' : 'off',
scriptid = t.data('id'),
data = {
action: 'hfcm-request',
toggle: true,
id: scriptid,
togvalue: togvalue,
security: hfcm_ajax.security
};
jQuery.post(
ajaxurl,
data
);
}
);
// Delete confirmation
jQuery('.snippets .delete > a').on(
'click', function () {
var name = jQuery(this).parents('.name').find('> strong').text();
return confirm('Snippet name: ' + name + '\n\nAre you sure you want to delete this snippet?');
}
);
function hfcmCopyToClipboard(elem)
{
// create hidden text element, if it doesn't already exist
var targetId = "_hiddenCopyText_";
var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
var origSelectionStart, origSelectionEnd;
// must use a temporary form element for the selection and copy
target = document.getElementById(targetId);
if (!target) {
var target = document.createElement("textarea");
target.style.position = "absolute";
target.style.left = "-9999px";
target.style.top = "0";
target.id = targetId;
document.body.appendChild(target);
}
target.textContent = elem.getAttribute('data-shortcode');
elem.textContent = "Copied!";
setTimeout(
function () {
elem.textContent = "Copy Shortcode";
}, 2000
);
// select the content
var currentFocus = document.activeElement;
target.focus();
target.setSelectionRange(0, target.value.length);
// copy the selection
var succeed;
try {
succeed = document.execCommand("copy");
} catch (e) {
succeed = false;
}
// restore original focus
if (currentFocus && typeof currentFocus.focus === "function") {
currentFocus.focus();
}
if (isInput) {
// restore prior selection
elem.setSelectionRange(origSelectionStart, origSelectionEnd);
} else {
// clear temporary content
target.textContent = "";
}
target.remove();
return succeed;
}
jQuery(
function ($) {
var elemsCopyBtn = document.getElementsByClassName('hfcm_copy_shortcode');
for (var i = 0; i < elemsCopyBtn.length; i++) {
elemsCopyBtn[i].addEventListener(
"click", function () {
hfcmCopyToClipboard(document.getElementById(this.id));
}
);
}
}
);

View File

@@ -0,0 +1,651 @@
msgid ""
msgstr ""
"Project-Id-Version: Header Footer Code Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-10 02:42+0530\n"
"PO-Revision-Date: 2022-12-10 02:42+0530\n"
"Last-Translator: fran <franmejia0@gmail.com>\n"
"Language-Team: \n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;__:1;_e:1;_c:1;"
"_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;_x:1,2c;_ex:1,2c;_nx:1,2,4c;"
"_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;esc_attr__:1;esc_html__:1;esc_attr_e:1;"
"esc_html_e:1;esc_attr_x:1,2c;esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;"
"transChoice:1,2\n"
"X-Loco-Target-Locale: hi_IN\n"
"X-Generator: Poedit 3.2.2\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../99robots-header-footer-code-manager.php:227
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:227
msgid "Header Footer Code Manager"
msgstr "हैडर फूटर कोड मैनेजर"
#: ../99robots-header-footer-code-manager.php:228
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:228
msgid "HFCM"
msgstr ""
#: ../99robots-header-footer-code-manager.php:238
#: ../99robots-header-footer-code-manager.php:239
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:238
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:239
msgid "All Snippets"
msgstr "सभी स्निपेट"
#: ../99robots-header-footer-code-manager.php:248
#: ../99robots-header-footer-code-manager.php:1135
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:248
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:1129
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:28
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:31
#: ../includes/hfcm-add-edit.php:28 ../includes/hfcm-add-edit.php:31
msgid "Add New Snippet"
msgstr "नया स्निपेट जोड़ें"
#: ../99robots-header-footer-code-manager.php:249
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:249
msgid "Add New"
msgstr "नया जोड़ें"
#: ../99robots-header-footer-code-manager.php:258
#: ../99robots-header-footer-code-manager.php:259
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:258
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:259
#: ../header-footer-code-manager/includes/hfcm-tools.php:23 ../includes/hfcm-tools.php:23
msgid "Tools"
msgstr "टूल्स"
#: ../99robots-header-footer-code-manager.php:268
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:268
msgid "Update Script"
msgstr "स्क्रिप्ट अपडेट करें"
#: ../99robots-header-footer-code-manager.php:269
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:269
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:413
#: ../includes/hfcm-add-edit.php:417
msgid "Update"
msgstr "अपडेट करें"
#: ../99robots-header-footer-code-manager.php:278
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:278
msgid "Request Handler Script"
msgstr ""
#: ../99robots-header-footer-code-manager.php:279
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:279
msgid "Request Handler"
msgstr ""
#: ../99robots-header-footer-code-manager.php:292
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:292
msgid "Settings"
msgstr "सेटिंग्स"
#: ../99robots-header-footer-code-manager.php:332
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:332
msgid ""
"Hey there! Youve been using the <strong>Header Footer Code Manager</strong> plugin for a "
"while now. If you like the plugin, please support our awesome development and support "
"team by leaving a <a class=\"hfcm-review-stars\" href=\"https://wordpress.org/support/"
"plugin/header-footer-code-manager/reviews/\"><span class=\"dashicons dashicons-star-"
"filled\"></span><span class=\"dashicons dashicons-star-filled\"></span><span "
"class=\"dashicons dashicons-star-filled\"></span><span class=\"dashicons dashicons-star-"
"filled\"></span><span class=\"dashicons dashicons-star-filled\"></span></a> rating. <a "
"href=\"https://wordpress.org/support/plugin/header-footer-code-manager/reviews/\">Rate it!"
"</a> Itll mean the world to us and keep this plugin free and constantly updated. <a "
"href=\"https://wordpress.org/support/plugin/header-footer-code-manager/reviews/\">Leave A "
"Review</a>"
msgstr ""
"नमस्ते! आप पिछले कुछ समय से <strong>हैडर फूटर कोड मैनेजर</strong> प्लगइन का उपयोग कर रहे हैं। यदि आप "
"प्लगइन पसंद करते हैं, तो कृपया <a class=\"hfcm-review-stars\" href=\"https://wordpress.org/"
"support/plugin/header-footer-code-manager/reviews/\"><span class=\"dashicons dashicons-"
"star-filled\"></span><span class=\"dashicons dashicons-star-filled\"></span><span "
"class=\"dashicons dashicons-star-filled\"></span><span class=\"dashicons dashicons-star-"
"filled\"></span><span class=\"dashicons dashicons-star-filled\"></span></a>रेटिंग देकर हमारी "
"शानदार विकास और सहायता टीम का समर्थन करें। <a href=\"https://wordpress.org/support/plugin/"
"header-footer-code-manager/reviews/\">इसे रेट करें!</a> यह हमारे लिए दुनिया का मतलब होगा और इस "
"प्लगइन को मुक्त और लगातार अपडेट रखेगा। <a href=\"https://wordpress.org/support/plugin/header-"
"footer-code-manager/reviews/\">समीक्षा लिखें</a>"
#: ../99robots-header-footer-code-manager.php:1098
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:1092
msgid ""
"Please deactivate the free version of this plugin in order to avoid duplication of the "
"snippets.\n"
" You can use our tools to import all the snippets from the free "
"version of this plugin."
msgstr ""
"स्निपेट्स के दोहराव से बचने के लिए कृपया इस प्लगइन के मुफ़्त संस्करण को निष्क्रिय करें।\n"
" आप इस प्लगइन के मुफ्त संस्करण से सभी स्निपेट आयात करने के लिए हमारे टूल का उपयोग "
"कर सकते हैं।"
#: ../99robots-header-footer-code-manager.php:1133
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:1127
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:18
#: ../includes/class-hfcm-snippets-list.php:18
msgid "Snippets"
msgstr "स्निपेट्स"
#: ../99robots-header-footer-code-manager.php:1142
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:1136
msgid "Search Snippets"
msgstr "स्निपेट खोजें"
#: ../99robots-header-footer-code-manager.php:1230
#: ../99robots-header-footer-code-manager.php:1245
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:1224
#: ../header-footer-code-manager/99robots-header-footer-code-manager.php:1239
msgid "Please upload a valid import file"
msgstr "कृपया एक मान्य आयात फ़ाइल अपलोड करें"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:17
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:401
#: ../includes/class-hfcm-snippets-list.php:17 ../includes/hfcm-add-edit.php:405
msgid "Snippet"
msgstr "स्निपेट"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:188
#: ../includes/class-hfcm-snippets-list.php:188
msgid "No Snippets available."
msgstr "कोई स्निपेट्स उपलब्ध नहीं."
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:208
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:99
#: ../includes/class-hfcm-snippets-list.php:208 ../includes/hfcm-add-edit.php:100
msgid "Site Wide"
msgstr "साइट व्यापक"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:209
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:100
#: ../includes/class-hfcm-snippets-list.php:209 ../includes/hfcm-add-edit.php:101
msgid "Specific Posts"
msgstr "विशिष्ट पोस्ट्स"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:210
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:101
#: ../includes/class-hfcm-snippets-list.php:210 ../includes/hfcm-add-edit.php:102
msgid "Specific Pages"
msgstr "विशिष्ट पृष्ठ"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:211
#: ../includes/class-hfcm-snippets-list.php:211
msgid "Specific Categories"
msgstr "विशिष्ट श्रेणियों"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:212
#: ../includes/class-hfcm-snippets-list.php:212
msgid "Specific Custom Post Types"
msgstr "विशिष्ट कस्टम पोस्ट प्रकार"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:213
#: ../includes/class-hfcm-snippets-list.php:213
msgid "Specific Tags"
msgstr "विशिष्ट टैग"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:214
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:105
#: ../includes/class-hfcm-snippets-list.php:214 ../includes/hfcm-add-edit.php:106
msgid "Home Page"
msgstr "होम पेज"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:215
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:106
#: ../includes/class-hfcm-snippets-list.php:215 ../includes/hfcm-add-edit.php:107
msgid "Search Page"
msgstr "खोज पृष्ठ"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:216
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:107
#: ../includes/class-hfcm-snippets-list.php:216 ../includes/hfcm-add-edit.php:108
msgid "Archive Page"
msgstr "संग्रह पृष्ठ"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:217
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:108
#: ../includes/class-hfcm-snippets-list.php:217 ../includes/hfcm-add-edit.php:109
msgid "Latest Posts"
msgstr "नवीनतम पोस्ट"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:218
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:109
#: ../includes/class-hfcm-snippets-list.php:218 ../includes/hfcm-add-edit.php:110
msgid "Shortcode Only"
msgstr "केवल छोटे संकेत"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:234
#: ../includes/class-hfcm-snippets-list.php:234
msgid "No post selected"
msgstr "कोई पोस्ट चयनित नहीं"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:243
#: ../includes/class-hfcm-snippets-list.php:243
msgid "N/A"
msgstr ""
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:247
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:13
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:292
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:299
#: ../header-footer-code-manager/includes/hfcm-tools.php:9
#: ../includes/class-hfcm-snippets-list.php:247 ../includes/hfcm-add-edit.php:13
#: ../includes/hfcm-add-edit.php:294 ../includes/hfcm-add-edit.php:301
#: ../includes/hfcm-tools.php:9
msgid "Header"
msgstr "हैडर"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:248
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:14
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:293
#: ../header-footer-code-manager/includes/hfcm-tools.php:10
#: ../includes/class-hfcm-snippets-list.php:248 ../includes/hfcm-add-edit.php:14
#: ../includes/hfcm-add-edit.php:295 ../includes/hfcm-tools.php:10
msgid "Before Content"
msgstr "प्रकरण से पहले"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:249
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:15
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:294
#: ../header-footer-code-manager/includes/hfcm-tools.php:11
#: ../includes/class-hfcm-snippets-list.php:249 ../includes/hfcm-add-edit.php:15
#: ../includes/hfcm-add-edit.php:296 ../includes/hfcm-tools.php:11
msgid "After Content"
msgstr "प्रकरण के बाद"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:250
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:16
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:295
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:300
#: ../header-footer-code-manager/includes/hfcm-tools.php:12
#: ../includes/class-hfcm-snippets-list.php:250 ../includes/hfcm-add-edit.php:16
#: ../includes/hfcm-add-edit.php:297 ../includes/hfcm-add-edit.php:302
#: ../includes/hfcm-tools.php:12
msgid "Footer"
msgstr "फूटर"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:257
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:326
#: ../includes/class-hfcm-snippets-list.php:257 ../includes/hfcm-add-edit.php:328
msgid "Show on All Devices"
msgstr "सभी उपकरणों पर दिखाना"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:259
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:328
#: ../includes/class-hfcm-snippets-list.php:259 ../includes/hfcm-add-edit.php:330
msgid "Only Mobile Devices"
msgstr "केवल मोबाइल उपकरणों"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:261
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:327
#: ../includes/class-hfcm-snippets-list.php:261 ../includes/hfcm-add-edit.php:329
msgid "Only Desktop"
msgstr "केवल डेस्कटॉप"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:267
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:413
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:75
#: ../includes/class-hfcm-snippets-list.php:267 ../includes/class-hfcm-snippets-list.php:413
#: ../includes/hfcm-add-edit.php:76
msgid "HTML"
msgstr ""
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:268
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:414
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:76
#: ../includes/class-hfcm-snippets-list.php:268 ../includes/class-hfcm-snippets-list.php:414
#: ../includes/hfcm-add-edit.php:77
msgid "CSS"
msgstr ""
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:269
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:415
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:77
#: ../includes/class-hfcm-snippets-list.php:269 ../includes/class-hfcm-snippets-list.php:415
#: ../includes/hfcm-add-edit.php:78
msgid "Javascript"
msgstr ""
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:343
#: ../includes/class-hfcm-snippets-list.php:343
msgid "Edit"
msgstr "संपादित करें"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:344
#: ../includes/class-hfcm-snippets-list.php:344
msgid "Copy Shortcode"
msgstr "शोर्टकोड कॉपी करें"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:345
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:419
#: ../includes/class-hfcm-snippets-list.php:345 ../includes/hfcm-add-edit.php:424
msgid "Delete"
msgstr "मिटाएं"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:360
#: ../includes/class-hfcm-snippets-list.php:360
msgid "ID"
msgstr "आईडी"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:361
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:351
#: ../includes/class-hfcm-snippets-list.php:361 ../includes/hfcm-add-edit.php:353
msgid "Status"
msgstr "स्थिति"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:362
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:68
#: ../includes/class-hfcm-snippets-list.php:362 ../includes/hfcm-add-edit.php:68
msgid "Snippet Name"
msgstr "स्निपेट नाम"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:363
#: ../includes/class-hfcm-snippets-list.php:363
msgid "Display On"
msgstr "पर प्रदर्शन"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:364
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:306
#: ../includes/class-hfcm-snippets-list.php:364 ../includes/hfcm-add-edit.php:308
msgid "Location"
msgstr "स्थान"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:365
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:81
#: ../includes/class-hfcm-snippets-list.php:365 ../includes/hfcm-add-edit.php:82
msgid "Snippet Type"
msgstr "स्निपेट प्रकार"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:366
#: ../includes/class-hfcm-snippets-list.php:366
msgid "Devices"
msgstr "उपकरण"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:367
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:368
#: ../includes/class-hfcm-snippets-list.php:367 ../includes/hfcm-add-edit.php:370
msgid "Shortcode"
msgstr "छोटे संकेत"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:397
#: ../includes/class-hfcm-snippets-list.php:397
msgid "Activate"
msgstr "सक्रिय करें"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:398
#: ../includes/class-hfcm-snippets-list.php:398
msgid "Deactivate"
msgstr "निष्क्रिय करें"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:399
#: ../includes/class-hfcm-snippets-list.php:399
msgid "Remove"
msgstr "हटा दें"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:420
#: ../includes/class-hfcm-snippets-list.php:420
msgid "All Snippet Types"
msgstr "सभी प्रकार के स्निपेट"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:431
#: ../includes/class-hfcm-snippets-list.php:431
msgid "Filter"
msgstr "फिल्टर"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:491
#: ../includes/class-hfcm-snippets-list.php:491
msgid "All"
msgstr "सभी टुकड़े"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:496
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:331
#: ../includes/class-hfcm-snippets-list.php:496 ../includes/hfcm-add-edit.php:333
msgid "Active"
msgstr "सक्रिय"
#: ../header-footer-code-manager/includes/class-hfcm-snippets-list.php:501
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:332
#: ../includes/class-hfcm-snippets-list.php:501 ../includes/hfcm-add-edit.php:334
msgid "Inactive"
msgstr "निष्क्रिय"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:28
#: ../includes/hfcm-add-edit.php:28
msgid "Edit Snippet"
msgstr "स्निपेट सम्पादन"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:40
#: ../includes/hfcm-add-edit.php:40
msgid "Script updated"
msgstr "स्क्रिप्ट अद्यतन"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:42
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:47
#: ../includes/hfcm-add-edit.php:42 ../includes/hfcm-add-edit.php:47
msgid "Back to list"
msgstr "दोबारा सूची पर जाएं"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:45
#: ../includes/hfcm-add-edit.php:45
msgid "Script Added Successfully"
msgstr "स्क्रिप्ट जोड़ा सफलतापूर्वक"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:102
#: ../includes/hfcm-add-edit.php:103
msgid "Specific Categories (Archive & Posts)"
msgstr "विशिष्ट श्रेणियाँ (संग्रह और पोस्ट)"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:103
#: ../includes/hfcm-add-edit.php:104
msgid "Specific Post Types (Archive & Posts)"
msgstr "विशिष्ट पोस्ट प्रकार (संग्रह और पोस्ट)"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:104
#: ../includes/hfcm-add-edit.php:105
msgid "Specific Tags (Archive & Posts)"
msgstr "विशिष्ट टैग (संग्रह और पोस्ट)"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:112
#: ../includes/hfcm-add-edit.php:113
msgid "Site Display"
msgstr "साइट प्रदर्शन"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:139
#: ../includes/hfcm-add-edit.php:140
msgid "Exclude Pages"
msgstr "पृष्ठों को बाहर करें"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:156
#: ../includes/hfcm-add-edit.php:157
msgid "Exclude Posts"
msgstr "पोस्ट को बाहर करें"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:170
#: ../includes/hfcm-add-edit.php:171
msgid "Page List"
msgstr "पेज सूची"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:189
#: ../includes/hfcm-add-edit.php:190
msgid "Post List"
msgstr "पोस्ट सूची"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:222
#: ../includes/hfcm-add-edit.php:223
msgid "Category List"
msgstr "श्रेणी सूची"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:240
#: ../includes/hfcm-add-edit.php:241
msgid "Tags List"
msgstr "टैग सूची"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:258
#: ../includes/hfcm-add-edit.php:259
msgid "Post Types"
msgstr "पोस्ट प्रकार"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:274
#: ../includes/hfcm-add-edit.php:275
msgid "Post Count"
msgstr "पोस्ट गिनती"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:321
#: ../includes/hfcm-add-edit.php:323
msgid "Note"
msgstr "ध्यान दें"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:321
#: ../includes/hfcm-add-edit.php:323
msgid ""
"Not all locations (such as before content) exist on all page/post types. The location "
"will only appear as an option if the appropriate hook exists on the page."
msgstr "सभी पेज/पोस्ट प्रकारों पर सभी स्थान (जैसे कि प्रकरण से पहले) मौजूद नहीं हैं।"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:335
#: ../includes/hfcm-add-edit.php:337
msgid "Device Display"
msgstr "डिवाइस प्रदर्शन"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:375
#: ../includes/hfcm-add-edit.php:379
msgid "Copy"
msgstr "कॉपी"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:384
#: ../includes/hfcm-add-edit.php:388
msgid "Changelog"
msgstr "चैंज लॉग"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:388
#: ../includes/hfcm-add-edit.php:392
msgid "Snippet created by"
msgstr "के द्वारा बनाई गई स्निपेट"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:389
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:393
#: ../includes/hfcm-add-edit.php:393 ../includes/hfcm-add-edit.php:397
msgid "on"
msgstr "पर"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:389
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:393
#: ../includes/hfcm-add-edit.php:393 ../includes/hfcm-add-edit.php:397
msgid "at"
msgstr "पर"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:392
#: ../includes/hfcm-add-edit.php:396
msgid "Last edited by"
msgstr "अंतिम बार संपादित द्वारा"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:402
#: ../includes/hfcm-add-edit.php:406
msgid "Code"
msgstr "कोड"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:408
#: ../includes/hfcm-add-edit.php:412
msgid ""
"Warning: Using improper code or untrusted sources code can break your site or create "
"security risks. <a href=\"https://draftpress.com/security-risks-of-wp-plugins-that-allow-"
"code-editing-or-insertion\" target=\"_blank\">Learn more</a>."
msgstr ""
"चेतावनी: अनुचित कोड या अविश्वसनीय स्रोत कोड का उपयोग करने से आपकी साइट टूट सकती है या सुरक्षा जोखिम "
"पैदा हो सकते हैं। <a href=\"https://draftpress.com/security-risks-of-wp-plugins-that-allow-"
"code-editing-or-insertion\" target=\"_blank\">और जानें</a> ।"
#: ../header-footer-code-manager/includes/hfcm-add-edit.php:413
#: ../includes/hfcm-add-edit.php:417
msgid "Save"
msgstr "जमा करें"
#: ../header-footer-code-manager/includes/hfcm-tools.php:30 ../includes/hfcm-tools.php:30
msgid "Export Snippets"
msgstr "निर्यात स्निपेट"
#: ../header-footer-code-manager/includes/hfcm-tools.php:37 ../includes/hfcm-tools.php:37
msgid ""
"Select the snippets you would like to export and then select your export method. Use the\n"
" download button to export to a .json file which you can "
"then import to another HFCM\n"
" installation"
msgstr ""
"उन स्निपेट का चयन करें जिन्हें आप निर्यात करना चाहते हैं और फिर अपनी निर्यात विधि चुनें। एक .json फ़ाइल में "
"निर्यात करने के लिए डाउनलोड बटन का उपयोग करें जिसे आप फिर किसी अन्य HFCM स्थापना में आयात कर सकते हैं"
#: ../header-footer-code-manager/includes/hfcm-tools.php:43 ../includes/hfcm-tools.php:43
msgid ""
"NOTE: Import/Export Functionality is only intended to operate within the same website. "
"Using the export/import to move snippets from one website to a different site, may result "
"in inconsistent behavior, particularly if you have specific elements as criteria such as "
"pages, posts, categories, or tags."
msgstr ""
"नोट: आयात/निर्यात कार्यक्षमता केवल उसी वेबसाइट के भीतर संचालित करने के लिए अभिप्रेत है। स्निपेट को एक "
"वेबसाइट से दूसरी साइट पर ले जाने के लिए निर्यात/आयात का उपयोग करने के परिणामस्वरूप असंगत व्यवहार हो "
"सकता है, खासकर यदि आपके पास विशिष्ट तत्व जैसे पृष्ठ, पोस्ट, श्रेणियां या टैग हैं।"
#: ../header-footer-code-manager/includes/hfcm-tools.php:49 ../includes/hfcm-tools.php:49
msgid "Select Snippets"
msgstr "स्निपेट्स का चयन करें"
#: ../header-footer-code-manager/includes/hfcm-tools.php:75 ../includes/hfcm-tools.php:75
msgid "Export File"
msgstr "निर्यात फ़ाइल"
#: ../header-footer-code-manager/includes/hfcm-tools.php:85 ../includes/hfcm-tools.php:85
msgid "Import Snippets"
msgstr "स्निपेट आयात करें"
#: ../header-footer-code-manager/includes/hfcm-tools.php:92 ../includes/hfcm-tools.php:92
msgid ""
"Select the HFCM JSON file you would like to import. When you click the import button "
"below,\n"
" HFCM will import the field groups."
msgstr ""
"वह HFCM JSON फ़ाइल चुनें जिसे आप आयात करना चाहते हैं। जब आप नीचे दिए गए आयात बटन पर क्लिक करते हैं, तो "
"HFCM फ़ील्ड समूहों को आयात करेगा।"
#: ../header-footer-code-manager/includes/hfcm-tools.php:100 ../includes/hfcm-tools.php:100
msgid "Select File"
msgstr "फ़ाइल का चयन करें"
#: ../header-footer-code-manager/includes/hfcm-tools.php:117 ../includes/hfcm-tools.php:117
msgid "Import"
msgstr "आयात"
#: ../includes/hfcm-add-edit.php:442
msgid ""
"Your site has <a href=\"https://draftpress.com/disallow-file-edit-setting-wordpress\" "
"target=\"_blank\">WP_DISALLOW_FILE_EDITS</a> setting enabled inside the wp-config file fo "
"prevent file edits. By using this plugin, you acknowledge that you know what youre doing "
"and intend on adding code snippets only from trusted sources."
msgstr ""
"फ़ाइल संपादन को रोकने के लिए आपकी साइट में <a href=\"https://draftpress.com/disallow-file-edit-"
"setting-wordpress\" target=\"_blank\">WP_DISALLOW_FILE_EDITS</a> सेटिंग wp-config फ़ाइल के "
"अंदर सक्षम है। इस प्लगइन का उपयोग करके, आप स्वीकार करते हैं कि आप जानते हैं कि आप क्या कर रहे हैं और केवल "
"विश्वसनीय स्रोतों से कोड स्निपेट जोड़ने का इरादा रखते हैं।"
#~ msgid "Snippet will only execute if the placement hook exists on the page"
#~ msgstr "पृष्ठ पर प्लेसमेंट हुक मौजूद होने पर ही स्निपेट निष्पादित होगा"
#~ msgid ""
#~ "Header Footer Code Manager by 99 Robots is a quick and simple way for you to add "
#~ "tracking code snippets, conversion pixels, or other scripts required by third party "
#~ "services for analytics, tracking, marketing, or chat functions. For detailed "
#~ "documentation, please visit the plugin's <a href=\"https://99robots.com/\"> official "
#~ "page</a>."
#~ msgstr ""
#~ "\"हैडर और पाद संहिता प्रबंधक, 99 रोबोट्स द्वारा, आप ट्रैकिंग कोड के टुकड़े , रूपांतरण पिक्सल , या अन्य "
#~ "एनालिटिक्स विपणन के लिए तीसरे पक्ष के सेवाओं के लिए आवश्यक लिपियों, या चैट फन्क्शन्स शीघ्र और आसान "
#~ "तरीका से जोड़ सकते है। विस्तृत दस्तावेज के लिए, कृपया प्लगइन के <a href=\"https://99robots.com/"
#~ "\"> आधिकारिक पृष्ठ<a/> पर जाएँ"
#~ msgid "Script deleted"
#~ msgstr "आलेख नष्ट कर दिया"

View File

@@ -0,0 +1,307 @@
=== Header Footer Code Manager ===
Contributors: DraftPress, 99robots, charliepatel
Tags: header, footer, code manager, snippet, functions.php, tracking, google analytics, adsense, verification, pixel
Requires at least: 4.9
Requires PHP: 5.6.20
Tested up to: 6.4.3
Stable tag: 1.1.37
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://draftpress.com
Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for analytics, marketing, or chat features.
== Description ==
Header Footer Code Manager by 99 Robots is a easy interface to add snippets to the header or footer or above or below the content of your page.
= BENEFITS =
* Never have to worry about inadvertently breaking your site by adding code
* Avoid inadvertently placing snippets in the wrong place
* Eliminate the need for a dozen or more silly plugins just to add a small code snippet - Less plugins is always better!
* Never lose your code snippets when switching or changing themes
* Know exactly which snippets are loading on your site, where they display, and who added them
= FEATURES =
* Add an unlimited number of scripts and styles anywhere and on any post / page
* Manage which posts or pages the script loads
* Supports custom post types
* Supports ability to load only on a specific post or page, or latest posts
* Control where exactly on the page the script is loaded - head, footer, before content, or after content
* Script can load only on desktops or mobile. Enable or disable one or the other.
* Use shortcodes to manually place the code anywhere
* Label every snippet for easy reference
* Plugin logs which user added and last edited the snippet, and when
= PAGE DISPLAY OPTIONS =
1. Site wide on every post / page
2. Specific post
3. Specific page
4. Specific category
5. Specific tag
6. Specific custom post type
7. Latest posts only (you choose how many)
8. Manually place using shortcodes
= INJECTION LOCATIONS =
1. Head section
2. Footer
3. Top of content
4. Bottom of content
= DEVICE OPTIONS =
* Show on All Devices
* Only Desktop
* Only Mobile Devices
= SUPPORTED SERVICES =
* Google Analytics
* Google Adsense
* Google Tag Manager
* Clicky Web Analytics or other analytics tracking scripts
* Chat modules such as Olark, Drip, or
* Pinterest site verification
* Facebook Pixels, Facebook Scripts, Facebook og:image Tag
* Google Conversion Pixels
* Twitter
* Heatmaps from Crazy Egg, notification bars Hello Bar, etc.
* It can accept ANY code snippet (HTML / Javascript / CSS) from any service
* and the list goes on and on...
== MULTISITE NOTE ==
If using this plugin on a multisite network, please make sure that the plugin is activated on a subsite level only.
> #### Plugin Information
> * [Plugin Site](https://draftpress.com/products/header-footer-code-manager/)
> * [Plugin Documentation](https://www.draftpress.com/docs/header-footer-code-manager)
> * [Free Plugins on WordPress.org](https://profiles.wordpress.org/99robots#content-plugins)
> * [Premium Plugins](https://www.draftpress.com/products)
== Installation ==
1. Upload `header-footer-code-manager` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Go to plugins page to see instructions for shortcode and php template tags
NOTE: If using this plugin on a multisite network, please make sure that the plugin is activated on a subsite level only.
== Screenshots ==
1. HFCM Settings
2. Dashboard - All Snippets
3. Add New Snippet - Read the documentation at:
http://www.draftpress.com/docs/header-footer-code-manager
4. Choose where you want your snippet to be displayed
5. HFCM PRO vs. FREE
== Frequently Asked Questions ==
= Q. Why do my scripts appear as text on the website? =
A. Please make sure to enclose your script within script tags - <<script>> Insert Script Here <</script>>.
= Q. Where are this plugins Settings located? =
A. After activating the plugin, you can click on settings link under the plugin name OR you can click the HFCM tab on the left side navigation. From there, you can add, edit, remove, and review code snippets.
= Q. How do I add code snippets to all my posts/pages? =
A. With the version 1.1.4 of the HFCM plugin, we have replaced the Specific Custom Post Types with the ability to add code to All Post Types which include posts, pages, attachments and custom post types.
= Q. I have a question =
A. Since this is a free plugin, please ask all questions on the support forum here on WordPress.org. We will try to respond to every question within 48 hours.
= Q. How can I request a feature or encourage future development? =
A. Free plugins rely on user feedback. Therefore, the best thing you can do for us is to leave a review to encourage others to try the plugin. The more users, the more likely newer features will be added. That's a very small thing to ask for in exchange for a FREE plugin.
= Q. Do you support X or Y tracking scripts? =
A. If your script is not supported, just let us know and we'll look into it immediately. We will do our best to ensure all reputable services are supported. When requesting support for a particular script, it would be nice to get a sample of the script so that we can see its structure.
== Changelog ==
= 1.1.37 = 2024-01-31
* ADDED: Compatibility with WordPress 6.4.3
= 1.1.36 = 2023-09-04
* ADDED: Compatibility with WordPress 6.3.1
= 1.1.35 = 2023-07-04
* ADDED: WordPress nonce checks while performing bulk actions on the snippets
= 1.1.34 = 2023-06-27
* FIXED: Check if Woocommerce installed before using its functions
= 1.1.33 = 2023-06-26
* FIXED: Snippets not showing up on Woocommerce product categories and tags
* UPDATED: Compatibility with WordPress 6.2.2
* UPDATED: Compatibility with PHP 8.2
= 1.1.32 = 2022-12-16
* ADDED: Warning message to caution about file editing
* FIXED: Snippet including in case of rest api in some cases
= 1.1.31 = 2022-12-09
* ADDED: Warning message to caution users of using improper code or untrusted sources code that can break site or create security risks.
* UPDATED: Compatibility with WordPress 6.1.1
= 1.1.30 = 2022-11-09
* FIXED: Proper checks for user access and capabilities
* UPDATED: Compatibility with WordPress 6.1
= 1.1.29 = 2022-09-21
* FIXED: Description not showing on the RSS feed page
= 1.1.28 = 2022-09-18
* FIXED: Check for not rendering the snippets on the RSS feed page
* UPDATED: Compatibility with WordPress 6.0.2
= 1.1.27 = 2022-07-15
* FIXED: Internationalization support for PO Translation files. Plugin now supports translation to additional languages in addition to the base language, English.
* ADDED: 1 Translation for Hindi.
* UPDATED: Compatibility with WordPress 6.0.1
= 1.1.26 = 2022-07-01
* FIXED: Code snippet sanitization, removed due to incompatibility with functionality
= 1.1.25 = 2022-06-29
* UPDATED: Code improvements as per WordPress standards
= 1.1.24 = 2022-06-25
* FIXED: XSS Security Vulnerability fix
= 1.1.23 = 2022-06-10
* UPDATED: Compatibility with WordPress 6.0
= 1.1.22 = 2022-05-10
* FIXED: PHP warnings when adding/editing snippets
* UPDATED: Add confirmation before deleting snippets
* UPDATED: Copy shortcode button
= 1.1.21 = 2022-04-21
* ADDED: Copy shortcode to clipboard buttons on edit snippet page and on snippet list page
* UPDATED: Compatibility with WordPress 5.9.3
* UPDATED: Included Custom Taxonomies for snippets
* UPDATED: Snippet code editor size
* ADDED: Increased Number of Allowed Posts/Page Exclusions to 200K+ posts.
= 1.1.20 = 2022-03-26
* FIXED: MultiSite issue with subsites in network
= 1.1.19 = 2022-03-24
* FIXED: MultiSite slow query issue
* UPDATED: Compatibility with WordPress 5.9.2
= 1.1.18 = 2022-03-05
* ADDED: Ability to apply snippets to search, home, archive page only
* ADDED: Snippet search functionality
* ADDED: Snippet type filter
* ADDED: Snippet sort by location
* ADDED: Delete snippet button on edit snippet page
= 1.1.17 = 2022-02-17
* FIXED: XSS vulnerability with request parameter page in the HFCM snippet listing screen
* UPDATED: Compatibility with WordPress 5.9
* UPDATED: Text & Plugin assets
* UPDATED: Snippet column length
= 1.1.16 = 2021-12-13
* FIXED: Author not showing on Add/Edit snippet screen
* ADDED: PRO banner
* UPDATED: Text & Plugin icon
= 1.1.15 = 2021-10-26
* UPDATED: Code improvements as per WordPress standards
* Proper escaping
* Proper variable naming
* Added recommended spacing by WordPress
= 1.1.14 = 2021-10-08
* FIXED: SQL Vulnerability with listing orderby
* FIXED: DbDelta query
* UPDATED: Compatibility with WordPress 5.8.1
= 1.1.13 = 2021-09-06
* FIXED: bool function return type
* UPDATED: Minimum required PHP version
* UPDATED: Lowest WordPress version that the plugin will work on
= 1.1.12 = 2021-09-04
* FIXED: Import upload file type error
* FIXED: Location options for site display (specific categories)
* UPDATED: File format for the import/export files
* UPDATED: Compatibility with WordPress 5.8
= 1.1.11 = 2021-08-10
* FIXED: Warnings - Undefined Variables
* FIXED: Selectize issue of not able to select first option from the dropdown
* ADDED: Snippet types
* ADDED: Code Editor in place of textarea
* ADDED: Import/Export Snippets
* UPDATED: Compatibility with WordPress 5.8
= 1.1.10 = 2021-04-23
* FIXED: Warnings - Undefined Variables
* UPDATED: Compatibility with WordPress 5.7.1
= 1.1.9 = 2021-02-18
* UPDATED: Compatibility with WordPress 5.6.1
= 1.1.8 = 2020-09-01
* FIXED: Specific Taxonomy Snippets showing on archives with at least one instance.
* UPDATED: Compatibility with WordPress 5.5.0
= 1.1.7 = 2020-04-20
* UPDATED: Compatibility with WordPress 5.4.0
* FIXED: Warnings and Exclude Pages/Posts showing up on Shortcode Only screen
= 1.1.6 = 2019-09-22
* FIXED: Specific Pages targeting Blog index page, even when it is not selected.
= 1.1.5 = 2019-08-29
* FIXED: Unable to target Blog index page
= 1.1.4 = 2019-08-15
* UPDATED: All snippets list now shows 20 snippets in the first page instead of 10
* ADDED: Replaced Specific Custom Post Types under Site Display to include the functionality to add code snippets to all post types, including posts, pages, custom post types & attachments
* UPDATED: Compatibility with WordPress 5.2.2
= 1.1.3 = 2019-05-03
* UPDATED: Compatibility with WordPress 5.1.1
= 1.1.2 = 2019-01-07
* FIXED: Blank page on dismissing notice when on a few admin pages
* UPDATED: Admin notice will now only show on the HFCM plugin admin pages
= 1.1.1 = 2018-12-31
* FIXED: Warning - Unexpected Output - headers already sent
= 1.1.0 = 2018-12-31
* UPDATED: Code Optimization
* UPDATED: Added plugin settings link, and update documentation.
* Compatible with WordPress 5.0.2
= 1.0.9 = 2018-10-09
* UPDATED: Code Optimization
= 1.0.8 = 2018-10-04
* FIXED: Updated obsolete code causing errors.
= 1.0.7 = 2018-10-01
* ADDED: Functionality to Exclude Posts and Pages from the Site Wide option.
= 1.0.6 = 2018-07-10
* FIXED: Latest Posts dropdown selection always resets to 1 on save / update.
= 1.0.5 = 2018-06-14
* UPDATED: "All Snippets" page to show 10 snippets before pagination starts.
= 1.0.4 = 2018-05-23
* FIXED: style-admin.css not loading on "Add New Snippet" page.
* FIXED: Post List not loading when selecting "Specific Posts" in "Site Display" under Add New Snippet.
= 1.0.3 = 2017-06-09
* Compatible with WordPress 4.8
= 1.0.2 = 2016-9-22
* FIXED: Updated code triggering a fatal error for sites with older PHP versions.
= 1.0.1 = 2016-9-20
* FIXED: Updated code triggering a fatal error for sites with older PHP versions; now compatible.
= 1.0.0 = 2016-7-20
* Initial release - HFCM is born! :)

View File

@@ -0,0 +1,14 @@
<?php
// If uninstall is not called from WordPress, exit
if (! defined('WP_UNINSTALL_PLUGIN') ) {
exit;
}
$option_name = 'hfcm_db_version';
delete_option($option_name);
// Drop a custom db table
global $wpdb;
$table_name = $wpdb->prefix . 'hfcm_scripts';
$wpdb->query("DROP TABLE IF EXISTS $table_name");