|
Server : LiteSpeed System : Linux premium152.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64 User : idesfsze ( 1473) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/idesfsze/pandaexpressketo.com/wp-content/themes/jnews/class/Customizer/ |
<?php
/**
* @author : Jegtheme
*/
namespace JNews\Customizer;
/**
* Class Theme JNews Customizer
*/
class CodeOption extends CustomizerOptionAbstract {
/** section */
public function __construct( $customizer, $id ) {
parent::__construct( $customizer, $id );
}
/**
* Set Section
*/
public function set_option() {
$this->set_section();
$this->set_code_field();
}
public function set_section() {
$this->customizer->add_panel( [
'id' => 'jnews_code_panel',
'title' => esc_html__( 'Additonal Javascript', 'jnews' ),
'description' => esc_html__( 'Additonal Javascript', 'jnews' ),
'priority' => 250,
] );
$this->customizer->add_section( [
'id' => 'jnews_header_code_section',
'title' => esc_html__( 'Header Javascript', 'jnews' ),
'panel' => 'jnews_code_panel',
'priority' => 250,
] );
$this->customizer->add_section( [
'id' => 'jnews_footer_code_section',
'title' => esc_html__( 'Footer Javascript', 'jnews' ),
'panel' => 'jnews_code_panel',
'priority' => 250,
] );
}
public function set_code_field() {
$this->customizer->add_field( [
'id' => 'jnews_additional_header_js',
'transport' => 'refresh',
'default' => '',
'sanitize' => 'jnews_sanitize_by_pass',
'type' => 'jnews-textarea',
'section' => 'jnews_header_code_section',
'label' => esc_html__( 'Additional Javascript on Header', 'jnews' ),
'description' => esc_html__( 'Put your additional javascript code right here. This code will be placed on header', 'jnews' ),
] );
$this->customizer->add_field( [
'id' => 'jnews_additional_js',
'transport' => 'refresh',
'default' => '',
'sanitize' => 'jnews_sanitize_by_pass',
'type' => 'jnews-textarea',
'section' => 'jnews_footer_code_section',
'label' => esc_html__( 'Additional Javascript on Footer', 'jnews' ),
'description' => esc_html__( 'Put your additional javascript code right here. This code will be placed on footer', 'jnews' ),
] );
}
}