This commit is contained in:
2025-11-18 16:39:33 +00:00
parent c70394d367
commit df1f90c6cd
9673 changed files with 3464697 additions and 34 deletions
@@ -0,0 +1,198 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer;
defined( 'ABSPATH' ) || exit;
class Activator {
public static $instance = null;
protected $templates;
public $header_template;
public $footer_template;
protected $current_theme;
protected $current_template;
protected $post_type = 'elementskit_template';
public function __construct() {
add_action( 'wp', array( $this, 'hooks' ) );
}
public function hooks() {
$this->current_template = basename( get_page_template_slug() );
if ( $this->current_template == 'elementor_canvas' ) {
return;
}
$this->current_theme = get_template();
switch ( $this->current_theme ) {
case 'astra':
new Theme_Hooks\Astra( self::template_ids() );
break;
case 'neve':
new Theme_Hooks\Neve( self::template_ids() );
break;
case 'generatepress':
case 'generatepress-child':
new Theme_Hooks\Generatepress( self::template_ids() );
break;
case 'oceanwp':
case 'oceanwp-child':
new Theme_Hooks\Oceanwp( self::template_ids() );
break;
case 'bb-theme':
case 'bb-theme-child':
new Theme_Hooks\Bbtheme( self::template_ids() );
break;
case 'genesis':
case 'genesis-child':
new Theme_Hooks\Genesis( self::template_ids() );
break;
case 'twentynineteen':
new Theme_Hooks\TwentyNineteen( self::template_ids() );
break;
case 'my-listing':
case 'my-listing-child':
new Theme_Hooks\MyListing( self::template_ids() );
break;
default:
new Theme_Hooks\Theme_Support( self::template_ids() );
break;
}
}
public static function template_ids() {
$cached = wp_cache_get( 'elementskit_template_ids' );
if ( false !== $cached ) {
return $cached;
}
$instance = self::instance();
$instance->the_filter();
$ids = array(
$instance->header_template,
$instance->footer_template,
);
if ( $instance->header_template != null ) {
\ElementsKit_Lite\Utils::render_elementor_content_css( $instance->header_template );
}
if ( $instance->footer_template != null ) {
\ElementsKit_Lite\Utils::render_elementor_content_css( $instance->footer_template );
}
wp_cache_set( 'elementskit_template_ids', $ids );
return $ids;
}
protected function the_filter() {
$arg = array(
'posts_per_page' => -1,
'orderby' => 'id',
'order' => 'DESC',
'post_status' => 'publish',
'post_type' => $this->post_type,
'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
array(
'key' => 'elementskit_template_activation',
'value' => 'yes',
'compare' => '=',
),
),
);
$this->templates = get_posts( $arg );
// more conditions can be triggered at once
// don't use switch case
// may impliment and callable by dynamic class in future
// entire site
if ( ! is_admin() ) {
$filters = array(
array(
'key' => 'condition_a',
'value' => 'entire_site',
),
);
$this->get_header_footer( $filters );
}
}
protected function get_header_footer( $filters ) {
$template_id = array();
if ( $this->templates != null ) {
foreach ( $this->templates as $template ) {
$template = $this->get_full_data( $template );
$match_found = true;
// WPML Language Check
if ( defined( 'ICL_LANGUAGE_CODE' ) ) :
$current_lang = apply_filters( 'wpml_post_language_details', null, $template['ID'] );
if ( ! empty( $current_lang ) && ! $current_lang['different_language'] && ( $current_lang['language_code'] == ICL_LANGUAGE_CODE ) ) :
$template_id[ $template['type'] ] = $template['ID'];
endif;
endif;
foreach ( $filters as $filter ) {
if ( $filter['key'] == 'condition_singular_id' ) {
$ids = explode( ',', $template[ $filter['key'] ] );
if ( ! in_array( $filter['value'], $ids ) ) {
$match_found = false;
}
} elseif ( $template[ $filter['key'] ] != $filter['value'] ) {
$match_found = false;
}
if ( $filter['key'] == 'condition_a' && $template[ $filter['key'] ] == 'singular' && count( $filters ) < 2 ) {
$match_found = false;
}
}
if ( $match_found == true ) {
if ( $template['type'] == 'header' ) {
$this->header_template = isset( $template_id['header'] ) ? $template_id['header'] : $template['ID'];
}
if ( $template['type'] == 'footer' ) {
$this->footer_template = isset( $template_id['footer'] ) ? $template_id['footer'] : $template['ID'];
}
}
}
}
}
protected function get_full_data( $post ) {
if ( $post != null ) {
return array_merge(
(array) $post,
array(
'type' => get_post_meta( $post->ID, 'elementskit_template_type', true ),
'condition_a' => get_post_meta( $post->ID, 'elementskit_template_condition_a', true ),
'condition_singular' => get_post_meta( $post->ID, 'elementskit_template_condition_singular', true ),
'condition_singular_id' => get_post_meta( $post->ID, 'elementskit_template_condition_singular_id', true ),
)
);
}
}
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
}
@@ -0,0 +1 @@
#elementskit-template-modalinput-form .attr-modal-content{-webkit-transition:opaicty .5s ease;transition:opaicty .5s ease;position:relative}#elementskit-template-modalinput-form .attr-modal-content .ekit-spinner{position:absolute;top:50%!important;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:6}#elementskit-template-modalinput-form .attr-modal-body{min-height:434px;max-height:435px;overflow-y:auto;overflow-x:hidden}#elementskit-template-modalinput-form .attr-form-control{font-size:14px;height:50px;border:1px solid #e5e5e5;border-radius:5px}#elementskit-template-modalinput-form .attr-form-control:focus{border:1px solid #f2295b;-webkit-box-shadow:none;box-shadow:none;outline:0}#elementskit-template-modalinput-form .attr-input-label{display:inline-block;font-weight:700;font-size:14px}@media (max-width:767px){#elementskit-template-modalinput-form .attr-input-label{margin-bottom:10px}}@media (min-width:768px){#elementskit-template-modalinput-form .attr-input-label{min-width:30%}}#elementskit-template-modalinput-form .select2-container{display:block;min-width:70%;max-width:100%}#elementskit-template-modalinput-form .select2-container .select2-selection--multiple,#elementskit-template-modalinput-form .select2-container .select2-selection--single{height:50px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.07);box-shadow:0 1px 2px rgba(0,0,0,.07);padding:.375rem .75rem;border-radius:.25rem;line-height:1;font-size:14px;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#elementskit-template-modalinput-form .select2-container .select2-selection--multiple{height:auto}#elementskit-template-modalinput-form .select2-container .selection{display:block}#elementskit-template-modalinput-form .select2-container--default .select2-selection--single{border-color:#ddd}#elementskit-template-modalinput-form .select2-container--default .select2-selection--single .select2-selection__rendered{line-height:1;padding-left:0}#elementskit-template-modalinput-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%;width:30px}#elementskit-template-modalinput-form .select2-container--default .select2-selection--multiple{border-color:#ddd}@media (min-width:768px){#elementskit-template-modalinput-form .ekit-input-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}}#elementskit-template-modalinput-form .ekit-switch-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.loading .attr-modal-content::before{opacity:.8;position:absolute;content:"";top:0;left:0;height:100%;width:100%;background-color:#fff;-webkit-transition:opaicty .5s ease;transition:opaicty .5s ease;z-index:5;border-radius:inherit}.loading .ekit-spinner{display:block}.attr-modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%}.attr-modal-dialog-centered>form{width:100%}.modal-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0,0,0,.5)}.modal-backdrop{z-index:9999}.attr-modal{z-index:10000}.ekit_multipile_ajax_search_filed .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:1.5;font-size:.9em;border:none;border-radius:0;color:#6d7882}.elementskit_type_filter_tab_container .nav-tab:first-child{margin-left:0}.ekit-headerfooter-status{display:inline-block;margin-left:5px;padding:2px 5px 3px;color:#fff;background-color:#888;border-radius:3px;font-size:10px;line-height:1;font-weight:400}.ekit-headerfooter-status-active{background-color:#00cd00}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
jQuery(document).ready((function(t){"use strict";function e(e){t(".ekit-template-modalinput-title").val(e.title),t(".ekit-template-modalinput-condition_a").val(e.condition_a),t(".ekit-template-modalinput-condition_singular").val(e.condition_singular),t(".ekit-template-modalinput-condition_singular_id").val(e.condition_singular_id),t(".ekit-template-modalinput-type").val(e.type);var a=t(".ekit-template-modalinput-activition");"yes"==e.activation?a.prop("checked",!0):a.prop("checked",!1),t(".ekit-template-modalinput-activition, .ekit-template-modalinput-type, .ekit-template-modalinput-condition_a, .ekit-template-modalinput-condition_singular").trigger("change");var i=t(".ekit-template-modalinput-condition_singular_id");t.ajax({url:window.elementskit.resturl+"ajaxselect2/singular_list",dataType:"json",data:{ids:String(e.condition_singular_id)}}).then((function(e){null!==e&&e.results.length>0&&(i.html(" "),t.each(e.results,(function(t,e){var a=new Option(e.text,e.id,!0,!0);i.append(a).trigger("change")})),i.trigger({type:"select2:select",params:{data:e}}))}))}t(".row-actions .edit a, .page-title-action, .row-title").on("click",(function(a){a.preventDefault();var i=0,n=t("#elementskit_headerfooter_modal"),l=t(this).parents(".column-title"),o=t("#elementskit-template-modalinput-form").attr("data-nonce");if(n.addClass("loading"),n.modal("show"),l.length>0)i=l.find(".hidden").attr("id").split("_")[1],t.ajax({url:window.elementskit.resturl+"my-template/get/"+i,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(t){e(t),n.removeClass("loading")}});else{e({title:"",type:"header",condition_a:"entire_site",condition_singular:"all",activation:""}),n.removeClass("loading")}n.find("form").attr("data-ekit-id",i)})),t(".ekit-template-modalinput-type").on("change",(function(){var e=t(this).val(),a=t(".ekit-template-headerfooter-option-container");"section"==e?a.hide():a.show()})),t(".ekit-template-modalinput-condition_a").on("change",(function(){var e=t(this).val(),a=t(".ekit-template-modalinput-condition_singular-container");"singular"==e?a.show():a.hide()})),t(".ekit-template-modalinput-condition_singular").on("change",(function(){var e=t(this).val(),a=t(".ekit-template-modalinput-condition_singular_id-container");"selective"==e?a.show():a.hide()})),t(".elementskit-template-save-btn-editor").on("click",(function(){var e=t("#elementskit-template-modalinput-form");e.attr("data-open-editor","1"),e.trigger("submit")})),t("#elementskit-template-modalinput-form").on("submit",(function(e){e.preventDefault();var a=t("#elementskit_headerfooter_modal");a.addClass("loading");var i=t(this).serialize(),n=t(this).attr("data-ekit-id"),l=t(this).attr("data-open-editor"),o=t(this).attr("data-editor-url"),r=t(this).attr("data-nonce");t.ajax({url:window.elementskit.resturl+"my-template/update/"+n,data:i,type:"get",headers:{"X-WP-Nonce":r},dataType:"json",success:function(e){a.removeClass("loading");var i=t("#post-"+e.data.id);i.length>0&&(i.find(".column-type").html(e.data.type_html),i.find(".column-condition").html(e.data.cond_text),i.find(".row-title").html(e.data.title).attr("aria-label",e.data.title)),"1"==l?window.location.href=o+"?post="+e.data.id+"&action=elementor":"0"==n&&location.reload()}})})),t(".ekit-template-modalinput-condition_singular_id").select2({ajax:{url:window.elementskit.resturl+"ajaxselect2/singular_list",dataType:"json",data:function(t){return{s:t.term}}},cache:!0,placeholder:"--",dropdownParent:t("#elementskit_headerfooter_modal_body")});var a=t(".wp-header-end"),i="",n=new URL(window.location.href).searchParams.get("elementskit_type_filter");n=null==n?"all":n,t.each({all:"All",header:"Header",footer:"Footer"},(function(t,e){var a=function(t,e,a){null==a&&(a="");var i=new RegExp("\\b("+e+"=).*?(&|#|$)");return t.search(i)>=0?t.replace(i,"$1"+a+"$2"):(t=t.replace(/[?#]$/,""))+(t.indexOf("?")>0?"&":"?")+e+"="+a}(window.location.href,"elementskit_type_filter",t);i+=`\n <a href="${a}" class="${n==t?"elementskit_type_filter_active nav-tab-active":" "} elementskit_type_filter_tab_item nav-tab">${e}</a>\n `,i+="\n"})),a.after('<div class="elementskit_type_filter_tab_container nav-tab-wrapper">'+i+"</div><br/>")}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,117 @@
<?php
namespace ElementsKit_Lite;
defined( 'ABSPATH' ) || exit;
class ElementsKit_HeaderFooterBuilder_Api extends Core\Handler_Api {
public function config() {
$this->prefix = 'my-template';
$this->param = '/(?P<id>\w+)/';
}
public function get_update() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$id = $this->request['id'];
$open_editor = $this->request['open_editor'];
$title = ( $this->request['title'] == '' ) ? ( 'ElementsKit_Lite Template #' . time() ) : $this->request['title'];
$activation = $this->request['activation'];
$type = $this->request['type'];
$condition_a = ( $type == 'section' ) ? '' : $this->request['condition_a'];
$condition_singular = ( $type == 'section' ) ? '' : $this->request['condition_singular'];
$condition_singular_id = ( $type == 'section' ) ? '' : ( is_array( $this->request['condition_singular_id'] ) ? implode( ',', $this->request['condition_singular_id'] ) : $this->request['condition_singular_id'] );
$post_data = array(
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'elementskit_template',
);
$post = get_post( $id );
if ( $post == null ) {
// $post_data['post_author'] = $this->request['post_author'];
$id = wp_insert_post( $post_data );
} else {
$post_data['ID'] = $id;
wp_update_post( $post_data );
}
update_post_meta( $id, '_wp_page_template', 'elementor_canvas' );
update_post_meta( $id, 'elementskit_template_activation', $activation );
update_post_meta( $id, 'elementskit_template_type', $type );
update_post_meta( $id, 'elementskit_template_condition_a', $condition_a );
update_post_meta( $id, 'elementskit_template_condition_singular', $condition_singular );
update_post_meta( $id, 'elementskit_template_condition_singular_id', $condition_singular_id );
// if wpml is active and wpml not set for this post
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
global $sitepress;
$wpml_element_type = apply_filters( 'wpml_element_type', 'elementskit_template' );
$sitepress->set_element_language_details( $id, $wpml_element_type, false, $sitepress->get_current_language(), null, false );
}
if ( $open_editor == 'true' ) {
$url = get_admin_url() . '/post.php?post=' . $id . '&action=elementor';
wp_safe_redirect( $url );
exit;
} else {
$cond = ucwords(
str_replace(
'_',
' ',
$condition_a
. ( ( $condition_a == 'singular' )
? ( ( $condition_singular != '' )
? ( ' > ' . $condition_singular
. ( ( $condition_singular_id != '' )
? ' > ' . $condition_singular_id
: '' ) )
: '' )
: '' )
)
);
return array(
'saved' => true,
'data' => array(
'id' => $id,
'title' => $title,
'type' => $type,
'activation' => $activation,
'cond_text' => $cond,
'type_html' => ( ucfirst( $type ) . ( ( $activation == 'yes' )
? ( '<span class="ekit-headerfooter-status ekit-headerfooter-status-active">' . esc_html__( 'Active', 'elementskit-lite' ) . '</span>' )
: ( '<span class="ekit-headerfooter-status ekit-headerfooter-status-inactive">' . esc_html__( 'Inactive', 'elementskit-lite' ) . '</span>' ) ) ),
),
);
}
}
public function get_get() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$id = $this->request['id'];
$post = get_post( $id );
if ( $post != null ) {
return array(
'title' => $post->post_title,
'status' => $post->post_status,
'activation' => get_post_meta( $post->ID, 'elementskit_template_activation', true ),
'type' => get_post_meta( $post->ID, 'elementskit_template_type', true ),
'condition_a' => get_post_meta( $post->ID, 'elementskit_template_condition_a', true ),
'condition_singular' => get_post_meta( $post->ID, 'elementskit_template_condition_singular', true ),
'condition_singular_id' => get_post_meta( $post->ID, 'elementskit_template_condition_singular_id', true ),
);
}
return true;
}
}
new ElementsKit_HeaderFooterBuilder_Api();
@@ -0,0 +1,115 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer;
defined( 'ABSPATH' ) || exit;
class Cpt_Hooks {
public static $instance = null;
public function __construct() {
add_action( 'admin_init', array( $this, 'add_author_support_to_column' ), 10 );
add_filter( 'manage_elementskit_template_posts_columns', array( $this, 'set_columns' ) );
add_action( 'manage_elementskit_template_posts_custom_column', array( $this, 'render_column' ), 10, 2 );
add_filter( 'parse_query', array( $this, 'query_filter' ) );
}
public function add_author_support_to_column() {
add_post_type_support( 'elementskit_template', 'author' );
}
/**
* Set custom column for template list.
*/
public function set_columns( $columns ) {
$date_column = $columns['date'];
$author_column = $columns['author'];
unset( $columns['date'] );
unset( $columns['author'] );
$columns['type'] = esc_html__( 'Type', 'elementskit-lite' );
$columns['condition'] = esc_html__( 'Conditions', 'elementskit-lite' );
$columns['date'] = $date_column;
$columns['author'] = $author_column;
return $columns;
}
/**
* Render Column
*
* Enqueue js and css to frontend.
*
* @since 1.0.0
* @access public
*/
public function render_column( $column, $post_id ) {
switch ( $column ) {
case 'type':
$type = get_post_meta( $post_id, 'elementskit_template_type', true );
$active = get_post_meta( $post_id, 'elementskit_template_activation', true );
$output = ucfirst( $type ) . ( ( $active == 'yes' )
? ( '<span class="ekit-headerfooter-status ekit-headerfooter-status-active">' . esc_html__( 'Active', 'elementskit-lite' ) . '</span>' )
: ( '<span class="ekit-headerfooter-status ekit-headerfooter-status-inactive">' . esc_html__( 'Inactive', 'elementskit-lite' ) . '</span>' ) );
echo wp_kses($output, \ElementsKit_Lite\Utils::get_kses_array());
break;
case 'condition':
$cond = array(
'condition_a' => get_post_meta( $post_id, 'elementskit_template_condition_a', true ),
'condition_singular' => get_post_meta( $post_id, 'elementskit_template_condition_singular', true ),
'condition_singular_id' => get_post_meta( $post_id, 'elementskit_template_condition_singular_id', true ),
);
echo esc_html(ucwords(
str_replace(
'_',
' ',
$cond['condition_a']
. ( ( $cond['condition_a'] == 'singular' )
? ( ( $cond['condition_singular'] != '' )
? ( ' > ' . $cond['condition_singular']
. ( ( $cond['condition_singular_id'] != '' )
? ' > ' . $cond['condition_singular_id']
: '' ) )
: '' )
: '' )
)
));
break;
}
}
public function query_filter( $query ) {
global $pagenow;
$current_page = isset( $_GET['post_type'] ) ? sanitize_text_field(wp_unslash($_GET['post_type'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
if ( is_admin()
&& 'elementskit_template' == $current_page
&& 'edit.php' == $pagenow
&& isset( $_GET['elementskit_type_filter'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
&& $_GET['elementskit_type_filter'] != '' // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
&& $_GET['elementskit_type_filter'] != 'all' // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
) {
$type = sanitize_text_field(wp_unslash($_GET['elementskit_type_filter'])); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
$query->query_vars['meta_key'] = 'elementskit_template_type'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key
$query->query_vars['meta_value'] = $type; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value
$query->query_vars['meta_compare'] = '=';
}
}
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
}
@@ -0,0 +1,77 @@
<?php
namespace ElementsKit_Lite\Modules\HeaderFooterBuilder;
defined( 'ABSPATH' ) || exit;
class Cpt {
public function __construct() {
$this->post_type();
add_action( 'admin_menu', array( $this, 'cpt_menu' ) );
add_filter( 'single_template', array( $this, 'load_canvas_template' ) );
}
public function post_type() {
$labels = array(
'name' => esc_html__( 'Templates', 'elementskit-lite' ),
'singular_name' => esc_html__( 'Template', 'elementskit-lite' ),
'menu_name' => esc_html__( 'Header Footer', 'elementskit-lite' ),
'name_admin_bar' => esc_html__( 'Header Footer', 'elementskit-lite' ),
'add_new' => esc_html__( 'Add New', 'elementskit-lite' ),
'add_new_item' => esc_html__( 'Add New Template', 'elementskit-lite' ),
'new_item' => esc_html__( 'New Template', 'elementskit-lite' ),
'edit_item' => esc_html__( 'Edit Template', 'elementskit-lite' ),
'view_item' => esc_html__( 'View Template', 'elementskit-lite' ),
'all_items' => esc_html__( 'All Templates', 'elementskit-lite' ),
'search_items' => esc_html__( 'Search Templates', 'elementskit-lite' ),
'parent_item_colon' => esc_html__( 'Parent Templates:', 'elementskit-lite' ),
'not_found' => esc_html__( 'No Templates found.', 'elementskit-lite' ),
'not_found_in_trash' => esc_html__( 'No Templates found in Trash.', 'elementskit-lite' ),
);
$args = array(
'labels' => $labels,
'public' => true,
'rewrite' => false,
'show_ui' => true,
'show_in_menu' => false,
'show_in_nav_menus' => false,
'exclude_from_search' => true,
'capability_type' => 'page',
'show_in_rest' => true,
'rest_base' => 'elementskit-template',
'hierarchical' => false,
'supports' => array( 'title', 'thumbnail', 'elementor' ),
);
register_post_type( 'elementskit_template', $args );
}
public function cpt_menu() {
$link_our_new_cpt = 'edit.php?post_type=elementskit_template';
add_submenu_page( 'elementskit', esc_html__( 'Header Footer', 'elementskit-lite' ), esc_html__( 'Header Footer', 'elementskit-lite' ), 'manage_options', $link_our_new_cpt );
}
function load_canvas_template( $single_template ) {
global $post;
if ( 'elementskit_template' == $post->post_type ) {
$elementor_2_0_canvas = ELEMENTOR_PATH . '/modules/page-templates/templates/canvas.php';
if ( file_exists( $elementor_2_0_canvas ) ) {
return $elementor_2_0_canvas;
} else {
return ELEMENTOR_PATH . '/includes/page-templates/canvas.php';
}
}
return $single_template;
}
}
new Cpt();
@@ -0,0 +1,60 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer;
defined( 'ABSPATH' ) || exit;
class Init {
public $dir;
public $url;
public function __construct() {
// get current directory path
$this->dir = dirname( __FILE__ ) . '/';
// get current module's url
$this->url = \ElementsKit_Lite::plugin_url() . 'modules/header-footer/';
// enqueue scripts
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
// include all necessary files
$this->include_files();
add_action( 'admin_footer', array( $this, 'modal_view' ) );
Cpt_Hooks::instance();
Activator::instance();
}
public function include_files() {
include_once $this->dir . 'cpt.php';
include_once $this->dir . 'cpt-api.php';
}
public function modal_view() {
$screen = get_current_screen();
if ( $screen->id == 'edit-elementskit_template' ) {
include_once $this->dir . 'views/modal-editor.php';
}
}
public function enqueue_styles() {
$screen = get_current_screen();
if ( $screen->id == 'edit-elementskit_template' ) {
wp_enqueue_style( 'select2', $this->url . 'assets/css/select2.min.css', false, \ElementsKit_Lite::version() );
wp_enqueue_style( 'elementskit-menu-admin-style', $this->url . 'assets/css/admin-style.css', false, \ElementsKit_Lite::version() );
}
}
public function enqueue_scripts() {
$screen = get_current_screen();
if ( $screen->id == 'edit-elementskit_template' ) {
wp_enqueue_script( 'select2', $this->url . 'assets/js/select2.min.js', array( 'jquery' ), true, \ElementsKit_Lite::version() );
wp_enqueue_script( 'elementskit-menu-admin-script', $this->url . 'assets/js/admin-script.js', array( 'jquery' ), true, \ElementsKit_Lite::version() );
}
}
}
@@ -0,0 +1,71 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* Astra theme compatibility.
*/
class Astra {
/**
* Instance of Elementor Frontend class.
*
* @var \Elementor\Frontend()
*/
private $elementor;
private $header;
private $footer;
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
$this->header = $template_ids[0];
$this->footer = $template_ids[1];
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
$this->elementor = \Elementor\Plugin::instance();
}
if ( $this->header != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_header_markup' ), 10 );
add_action( 'astra_header', array( $this, 'add_plugin_header_markup' ) );
}
if ( $this->footer != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_footer_markup' ), 10 );
add_action( 'astra_footer', array( $this, 'add_plugin_footer_markup' ) );
}
}
// header actions
public function remove_theme_header_markup() {
remove_action( 'astra_header', 'astra_header_markup' );
}
public function add_plugin_header_markup() {
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->header ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
// footer actions
public function remove_theme_footer_markup() {
remove_action( 'astra_footer', 'astra_footer_markup' );
}
public function add_plugin_footer_markup() {
do_action( 'elementskit/template/before_footer' );
echo '<div class="ekit-template-content-markup ekit-template-content-footer">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->footer ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_footer' );
}
}
@@ -0,0 +1,91 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* BB theme theme compatibility.
*/
class Bbtheme {
/**
* Instance of Elementor Frontend class.
*
* @var \Elementor\Frontend()
*/
private $elementor;
private $header;
private $footer;
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
$this->header = $template_ids[0];
$this->footer = $template_ids[1];
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
$this->elementor = \Elementor\Plugin::instance();
}
if ( $this->header != null ) {
add_filter( 'fl_header_enabled', '__return_false' );
add_action( 'fl_before_header', array( $this, 'add_plugin_header_markup' ) );
}
if ( $this->footer != null ) {
add_filter( 'fl_footer_enabled', '__return_false' );
add_action( 'fl_after_content', array( $this, 'add_plugin_footer_markup' ) );
}
}
// header actions
public function add_plugin_header_markup() {
if ( class_exists( '\FLTheme' ) ) {
$header_layout = \FLTheme::get_setting( 'fl-header-layout' );
if ( 'none' == $header_layout || is_page_template( 'tpl-no-header-footer.php' ) ) {
return;
}
}
do_action( 'elementskit/template/before_header' );
?>
<header id="masthead" itemscope="itemscope" itemtype="https://schema.org/WPHeader">
<div class="ekit-template-content-markup ekit-template-content-header">
<?php
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->header ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
?>
</div>
</header>
<style>
[data-type="header"] {
display: none !important;
}
</style>
<?php
do_action( 'elementskit/template/after_header' );
}
// footer actions
public function add_plugin_footer_markup() {
if ( is_page_template( 'tpl-no-header-footer.php' ) ) {
return;
}
do_action( 'elementskit/template/before_footer' );
?>
<footer itemscope="itemscope" itemtype="https://schema.org/WPFooter">
<?php
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->footer ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
?>
</footer>
<?php
do_action( 'elementskit/template/after_footer' );
}
}
@@ -0,0 +1,72 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* GeneratePress theme compatibility.
*/
class Generatepress {
/**
* Instance of Elementor Frontend class.
*
* @var \Elementor\Frontend()
*/
private $elementor;
private $header;
private $footer;
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
$this->header = $template_ids[0];
$this->footer = $template_ids[1];
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
$this->elementor = \Elementor\Plugin::instance();
}
if ( $this->header != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_header_markup' ), 10 );
add_action( 'generate_header', array( $this, 'add_plugin_header_markup' ) );
}
if ( $this->footer != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_footer_markup' ), 10 );
add_action( 'generate_footer', array( $this, 'add_plugin_footer_markup' ) );
}
}
// header actions
public function remove_theme_header_markup() {
remove_action( 'generate_header', 'generate_construct_header' );
}
public function add_plugin_header_markup() {
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->header ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
// footer actions
public function remove_theme_footer_markup() {
remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
remove_action( 'generate_footer', 'generate_construct_footer' );
}
public function add_plugin_footer_markup() {
do_action( 'elementskit/template/before_footer' );
echo '<div class="ekit-template-content-markup ekit-template-content-footer">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->footer ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_footer' );
}
}
@@ -0,0 +1,133 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* Genesis theme compatibility.
*/
class Genesis {
/**
* Instance of Elementor Frontend class.
*
* @var \Elementor\Frontend()
*/
private $elementor;
private $header;
private $footer;
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
$this->header = $template_ids[0];
$this->footer = $template_ids[1];
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
$this->elementor = \Elementor\Plugin::instance();
}
if ( $this->header != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_header_markup' ), 10 );
add_action( 'ocean_header', array( $this, 'add_plugin_header_markup' ) );
add_action( 'genesis_header', array( $this, 'genesis_header_markup_open' ), 16 );
add_action( 'genesis_header', array( $this, 'genesis_header_markup_close' ), 25 ); }
if ( $this->footer != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_footer_markup' ), 10 );
add_action( 'genesis_footer', array( $this, 'genesis_footer_markup_open' ), 16 );
add_action( 'genesis_footer', array( $this, 'genesis_footer_markup_close' ), 25 );
add_action( 'ocean_footer', array( $this, 'add_plugin_footer_markup' ) );
}
}
// header actions
public function remove_theme_header_markup() {
for ( $priority = 0; $priority < 16; $priority ++ ) {
remove_all_actions( 'genesis_header', $priority );
}
}
/**
* Open markup for header.
*/
public function genesis_header_markup_open() {
genesis_markup(
array(
'html5' => '<header %s>',
'xhtml' => '<div id="header">',
'context' => 'site-header',
)
);
genesis_structural_wrap( 'header' );
}
/**
* Close MArkup for header.
*/
public function genesis_header_markup_close() {
genesis_structural_wrap( 'header', 'close' );
genesis_markup(
array(
'html5' => '</header>',
'xhtml' => '</div>',
)
);
}
public function add_plugin_header_markup() {
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->header ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
// footer actions
public function remove_theme_footer_markup() {
for ( $priority = 0; $priority < 16; $priority ++ ) {
remove_all_actions( 'genesis_footer', $priority );
}
}
/**
* Open markup for footer.
*/
public function genesis_footer_markup_open() {
genesis_markup(
array(
'html5' => '<footer %s>',
'xhtml' => '<div id="footer" class="footer">',
'context' => 'site-footer',
)
);
genesis_structural_wrap( 'footer', 'open' );
}
/**
* Close markup for footer.
*/
public function genesis_footer_markup_close() {
genesis_structural_wrap( 'footer', 'close' );
genesis_markup(
array(
'html5' => '</footer>',
'xhtml' => '</div>',
)
);
}
public function add_plugin_footer_markup() {
do_action( 'elementskit/template/before_footer' );
echo '<div class="ekit-template-content-markup ekit-template-content-footer">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->footer ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_footer' );
}
}
@@ -0,0 +1,45 @@
<?php
if ( ! function_exists( 'hfe_render_header' ) ) {
function hfe_render_header() {
global $elementskit_template_ids;
if ( $elementskit_template_ids[0] == null ) {
return;
}
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $elementskit_template_ids[0] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
}
if ( ! function_exists( 'get_hfe_header_id' ) ) {
function get_hfe_header_id() {
global $elementskit_template_ids;
return $elementskit_template_ids[0];
}
}
if ( ! function_exists( 'hfe_render_footer' ) ) {
function hfe_render_footer() {
global $elementskit_template_ids;
if ( $elementskit_template_ids[1] == null ) {
return;
}
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $elementskit_template_ids[1] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
}
if ( ! function_exists( 'get_hfe_footer_id' ) ) {
function get_hfe_footer_id() {
global $elementskit_template_ids;
return $elementskit_template_ids[1];
}
}
@@ -0,0 +1,21 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* MyListing support for the header footer.
*/
class MyListing {
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
global $elementskit_template_ids;
$elementskit_template_ids = $template_ids;
include 'my-listing-functions.php';
}
}
@@ -0,0 +1,68 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* Neve theme compatibility.
*/
class Neve {
/**
* Instance of Elementor Frontend class.
*
* @var \Elementor\Frontend()
*/
private $elementor;
private $header;
private $footer;
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
$this->header = $template_ids[0];
$this->footer = $template_ids[1];
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
$this->elementor = \Elementor\Plugin::instance();
}
if ( $this->header != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_header_markup' ), 10 );
add_action( 'neve_do_header', array( $this, 'add_plugin_header_markup' ) );
}
if ( $this->footer != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_footer_markup' ), 10 );
add_action( 'neve_do_footer', array( $this, 'add_plugin_footer_markup' ) );
}
}
// header actions
public function remove_theme_header_markup() {
remove_all_actions( 'hfg_header_render' );
}
public function add_plugin_header_markup() {
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->header ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
// footer actions
public function remove_theme_footer_markup() {
remove_all_actions( 'hfg_footer_render' );
}
public function add_plugin_footer_markup() {
do_action( 'elementskit/template/before_footer' );
echo '<div class="ekit-template-content-markup ekit-template-content-footer">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->footer ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_footer' );
}
}
@@ -0,0 +1,72 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* Oceanwp theme compatibility.
*/
class Oceanwp {
/**
* Instance of Elementor Frontend class.
*
* @var \Elementor\Frontend()
*/
private $elementor;
private $header;
private $footer;
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
$this->header = $template_ids[0];
$this->footer = $template_ids[1];
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
$this->elementor = \Elementor\Plugin::instance();
}
if ( $this->header != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_header_markup' ), 10 );
add_action( 'ocean_header', array( $this, 'add_plugin_header_markup' ) );
}
if ( $this->footer != null ) {
add_action( 'template_redirect', array( $this, 'remove_theme_footer_markup' ), 10 );
add_action( 'ocean_footer', array( $this, 'add_plugin_footer_markup' ) );
}
}
// header actions
public function remove_theme_header_markup() {
remove_action( 'ocean_top_bar', 'oceanwp_top_bar_template' );
remove_action( 'ocean_header', 'oceanwp_header_template' );
remove_action( 'ocean_page_header', 'oceanwp_page_header_template' );
}
public function add_plugin_header_markup() {
do_action( 'elementskit/template/before_header' );
echo '<div class="ekit-template-content-markup ekit-template-content-header">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->header ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_header' );
}
// footer actions
public function remove_theme_footer_markup() {
remove_action( 'ocean_footer', 'oceanwp_footer_template' );
}
public function add_plugin_footer_markup() {
do_action( 'elementskit/template/before_footer' );
echo '<div class="ekit-template-content-markup ekit-template-content-footer">';
echo \ElementsKit_Lite\Utils::render_elementor_content( $this->footer ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
echo '</div>';
do_action( 'elementskit/template/after_footer' );
}
}
@@ -0,0 +1,61 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* Force fully replace the header footer.
*/
class Theme_Support {
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
if ( $template_ids[0] != null ) {
add_action( 'get_header', array( $this, 'get_header' ) );
}
if ( $template_ids[1] != null ) {
add_action( 'get_footer', array( $this, 'get_footer' ) );
}
}
public function get_header( $name ) {
require __DIR__ . '/../views/theme-support-header.php';
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "header-{$name}.php";
}
$templates[] = 'header.php';
// Avoid running wp_head hooks again
remove_all_actions( 'wp_head' );
ob_start();
// It cause a `require_once` so, in the get_header it self it will not be required again.
locate_template( $templates, true );
ob_get_clean();
}
public function get_footer( $name ) {
require __DIR__ . '/../views/theme-support-footer.php';
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "footer-{$name}.php";
}
$templates[] = 'footer.php';
ob_start();
// It cause a `require_once` so, in the get_header it self it will not be required again.
locate_template( $templates, true );
ob_get_clean();
}
}
@@ -0,0 +1,75 @@
<?php
namespace ElementsKit_Lite\Modules\Header_Footer\Theme_Hooks;
defined( 'ABSPATH' ) || exit;
/**
* TwentyNineteen support for the header footer.
*/
class TwentyNineteen {
/**
* Run all the Actions / Filters.
*/
function __construct( $template_ids ) {
if ( $template_ids[0] != null ) {
add_action( 'get_header', array( $this, 'get_header' ) );
}
if ( $template_ids[1] != null ) {
add_action( 'get_footer', array( $this, 'get_footer' ) );
}
}
public function get_header( $name ) {
add_action(
'elementskit/template/after_header',
function() {
echo '<div id="page" class="site">';
echo '<div id="content" class="site-content">';
}
);
require __DIR__ . '/../views/theme-support-header.php';
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "header-{$name}.php";
}
$templates[] = 'header.php';
// Avoid running wp_head hooks again
remove_all_actions( 'wp_head' );
ob_start();
// It cause a `require_once` so, in the get_header it self it will not be required again.
locate_template( $templates, true );
ob_get_clean();
}
public function get_footer( $name ) {
add_action(
'elementskit/template/after_footer',
function() {
echo '</div></div>';
}
);
require __DIR__ . '/../views/theme-support-footer.php';
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "footer-{$name}.php";
}
$templates[] = 'footer.php';
ob_start();
// It cause a `require_once` so, in the get_header it self it will not be required again.
locate_template( $templates, true );
ob_get_clean();
}
}
@@ -0,0 +1,83 @@
<div class="attr-modal attr-fade" id="elementskit_headerfooter_modal" tabindex="-1" role="dialog" aria-labelledby="elementskit_headerfooter_modalLabel">
<div class="attr-modal-dialog attr-modal-dialog-centered" role="document">
<form action="" method="get" id="elementskit-template-modalinput-form" data-open-editor="0" data-editor-url="<?php echo esc_url(get_admin_url()); ?>" data-nonce="<?php echo esc_attr(wp_create_nonce( 'wp_rest' )); ?>">
<!-- <input type="hidden" name="post_author" value ="<?php //echo get_current_user_id(); ?>"> -->
<div class="attr-modal-content">
<div class="attr-modal-header">
<button type="button" class="attr-close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="attr-modal-title" id="elementskit_headerfooter_modalLabel"><?php esc_html_e( 'Template Settings', 'elementskit-lite' ); ?></h4>
</div>
<div class="attr-modal-body" id="elementskit_headerfooter_modal_body">
<div class="ekit-input-group">
<label class="attr-input-label"><?php esc_html_e( 'Title:', 'elementskit-lite' ); ?></label>
<input required type="text" name="title" class="ekit-template-modalinput-title attr-form-control">
</div>
<br />
<div class="ekit-input-group">
<label class="attr-input-label"><?php esc_html_e( 'Type:', 'elementskit-lite' ); ?></label>
<select name="type" class="ekit-template-modalinput-type attr-form-control">
<option value="header"><?php esc_html_e( 'Header', 'elementskit-lite' ); ?></option>
<option value="footer"><?php esc_html_e( 'Footer', 'elementskit-lite' ); ?></option>
</select>
</div>
<br />
<div class="ekit-template-headerfooter-option-container">
<div class="ekit-input-group">
<label class="attr-input-label"><?php esc_html_e( 'Conditions:', 'elementskit-lite' ); ?></label>
<select name="condition_a" class="ekit-template-modalinput-condition_a attr-form-control">
<option value="entire_site"><?php esc_html_e( 'Entire Site', 'elementskit-lite' ); ?></option>
<option value="singular"><?php esc_html_e( 'Singular (Only Pro)', 'elementskit-lite' ); ?></option>
<option value="archive"><?php esc_html_e( 'Archive (Only Pro)', 'elementskit-lite' ); ?></option>
</select>
</div>
<br>
<div class="ekit-template-modalinput-condition_singular-container">
<div class="ekit-input-group">
<label class="attr-input-label"></label>
<select name="condition_singular" class="ekit-template-modalinput-condition_singular attr-form-control">
<option value="all"><?php esc_html_e( 'All Singulars (Only Pro)', 'elementskit-lite' ); ?></option>
<option value="front_page"><?php esc_html_e( 'Front Page (Only Pro)', 'elementskit-lite' ); ?></option>
<option value="all_posts"><?php esc_html_e( 'All Posts (Only Pro)', 'elementskit-lite' ); ?></option>
<option value="all_pages"><?php esc_html_e( 'All Pages (Only Pro)', 'elementskit-lite' ); ?></option>
<option value="selective"><?php esc_html_e( 'Selective Singular (Only Pro)', 'elementskit-lite' ); ?></option>
<option value="404page"><?php esc_html_e( '404 Page (Only Pro)', 'elementskit-lite' ); ?></option>
</select>
</div>
<br>
<div class="ekit-template-modalinput-condition_singular_id-container ekit_multipile_ajax_search_filed">
<div class="ekit-input-group">
<label class="attr-input-label"></label>
<select multiple name="condition_singular_id" class="ekit-template-modalinput-condition_singular_id"></select>
</div>
<br />
</div>
<br>
</div>
<div class="ekit-switch-group">
<label class="attr-input-label"><?php esc_html_e( 'Activate/Deactivate:', 'elementskit-lite' ); ?></label>
<div class="ekit-admin-input-switch">
<input checked="" type="checkbox" value="yes"
class="ekit-admin-control-input ekit-template-modalinput-activition"
name="activation" id="ekit_activation_modal_input">
<label class="ekit-admin-control-label" for="ekit_activation_modal_input">
<span class="ekit-admin-control-label-switch" data-active="ON"
data-inactive="OFF"></span>
</label>
</div>
</div>
</div>
<br>
</div>
<div class="attr-modal-footer">
<button type="button" class="attr-btn attr-btn-default elementskit-template-save-btn-editor"><?php esc_html_e( 'Edit content', 'elementskit-lite' ); ?></button>
<button type="submit" class="attr-btn attr-btn-primary elementskit-template-save-btn"><?php esc_html_e( 'Save changes', 'elementskit-lite' ); ?></button>
</div>
<div class="ekit-spinner"></div>
</div>
</form>
</div>
</div>
@@ -0,0 +1,12 @@
<?php do_action( 'elementskit/template/before_footer' ); ?>
<div class="ekit-template-content-markup ekit-template-content-footer ekit-template-content-theme-support">
<?php
$template = \ElementsKit_Lite\Modules\Header_Footer\Activator::template_ids();
echo \ElementsKit_Lite\Utils::render_elementor_content( $template[1] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
?>
</div>
<?php do_action( 'elementskit/template/after_footer' ); ?>
<?php wp_footer(); ?>
</body>
</html>
@@ -0,0 +1,50 @@
<?php
/**
* The template for displaying the header
*
* This is the template that displays all of the <head> section, opens the <body> tag and adds the site's header.
*
* @package ElementsKit_Lite
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$enable_skip_link = apply_filters( 'elementskit_enable_skip_link', true );
$skip_link_url = apply_filters( 'elementskit_skip_link_url', '#content' );
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php if (! current_theme_supports('title-tag')) : ?>
<title>
<?php echo esc_html(wp_get_document_title()); ?>
</title>
<?php endif; ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php if ($enable_skip_link) { ?>
<a class="skip-link screen-reader-text" href="<?php echo esc_url($skip_link_url); ?>">
<?php echo esc_html__('Skip to content', 'elementskit-lite'); ?>
</a>
<?php } ?>
<?php do_action('elementskit/template/before_header'); ?>
<div class="ekit-template-content-markup ekit-template-content-header ekit-template-content-theme-support">
<?php
$template = \ElementsKit_Lite\Modules\Header_Footer\Activator::template_ids();
echo \ElementsKit_Lite\Utils::render_elementor_content($template[0]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Displaying with Elementor content rendering
?>
</div>
<?php do_action('elementskit/template/after_header'); ?>