File: /var/www/newfaith.focalat.com/new-faith/wp-content/themes/christian/kits/settings/single/single.php
<?php
namespace ChristianSpace\Kits\Settings\Single;
use ChristianSpace\Kits\Controls\Controls_Manager as CmsmastersControls;
use ChristianSpace\Kits\Settings\Base\Settings_Tab_Base;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Single settings.
*/
class Single extends Settings_Tab_Base {
/**
* Get toggle name.
*
* Retrieve the toggle name.
*
* @return string Toggle name.
*/
public static function get_toggle_name() {
return 'single';
}
/**
* Get title.
*
* Retrieve the toggle title.
*/
public function get_title() {
return esc_html__( 'Single', 'christian' );
}
/**
* Get control ID prefix.
*
* Retrieve the control ID prefix.
*
* @return string Control ID prefix.
*/
protected static function get_control_id_prefix() {
$toggle_name = self::get_toggle_name();
return parent::get_control_id_prefix() . "_{$toggle_name}";
}
/**
* Register toggle controls.
*
* Registers the controls of the kit settings tab toggle.
*/
protected function register_toggle_controls() {
$this->add_control(
'notice',
array(
'raw' => esc_html__( "If you use an 'Singular' template, then the settings will not be applied, if you set the template to 'All Singular', then these settings will be hidden.", 'christian' ),
'type' => Controls_Manager::RAW_HTML,
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
'render_type' => 'ui',
)
);
$this->add_control(
'layout',
array(
'label' => esc_html__( 'Layout', 'christian' ),
'label_block' => false,
'description' => esc_html__( 'This setting will be applied after save and reload.', 'christian' ),
'type' => CmsmastersControls::CHOOSE_TEXT,
'options' => array(
'l-sidebar' => array(
'title' => esc_html__( 'Left', 'christian' ),
'description' => esc_html__( 'Left Sidebar', 'christian' ),
),
'fullwidth' => array(
'title' => esc_html__( 'Full', 'christian' ),
'description' => esc_html__( 'Full Width', 'christian' ),
),
'r-sidebar' => array(
'title' => esc_html__( 'Right', 'christian' ),
'description' => esc_html__( 'Right Sidebar', 'christian' ),
),
),
'default' => $this->get_default_setting(
$this->get_control_name_parameter( '', 'layout' ),
'r-sidebar'
),
'toggle' => false,
)
);
$this->add_control(
'elements_heading_control',
array(
'label' => esc_html__( 'Elements Order', 'christian' ),
'type' => Controls_Manager::HEADING,
)
);
$this->add_control(
'elements',
array(
'label_block' => true,
'show_label' => false,
'description' => esc_html__( 'This setting will be applied after save and reload.', 'christian' ),
'type' => CmsmastersControls::SELECTIZE,
'options' => array(
'media' => esc_html__( 'Media', 'christian' ),
'title' => esc_html__( 'Title', 'christian' ),
'meta_first' => esc_html__( 'Meta Data 1', 'christian' ),
'meta_second' => esc_html__( 'Meta Data 2', 'christian' ),
'content' => esc_html__( 'Content', 'christian' ),
),
'default' => $this->get_default_setting(
$this->get_control_name_parameter( '', 'elements' ),
array(
'media',
'title',
'meta_first',
'content',
'meta_second',
)
),
'multiple' => true,
)
);
$this->add_control(
'heading_visibility',
array(
'label' => esc_html__( 'Heading Visibility', 'christian' ),
'description' => esc_html__( 'This setting will be applied after save and reload.', 'christian' ),
'type' => Controls_Manager::SWITCHER,
'label_off' => esc_html__( 'Hide', 'christian' ),
'label_on' => esc_html__( 'Show', 'christian' ),
'default' => $this->get_default_setting(
$this->get_control_name_parameter( '', 'heading_visibility' ),
'yes'
),
)
);
$this->add_control(
'blocks_heading_control',
array(
'label' => esc_html__( 'Blocks Order', 'christian' ),
'type' => Controls_Manager::HEADING,
)
);
$this->add_control(
'blocks',
array(
'label_block' => true,
'show_label' => false,
'description' => esc_html__( 'This setting will be applied after save and reload.', 'christian' ),
'type' => CmsmastersControls::SELECTIZE,
'options' => array(
'nav' => esc_html__( 'Posts Navigation', 'christian' ),
'author' => esc_html__( 'Author Box', 'christian' ),
'more_posts' => esc_html__( 'More Posts', 'christian' ),
),
'default' => $this->get_default_setting(
$this->get_control_name_parameter( '', 'blocks' ),
array(
'nav',
'author',
'more_posts',
)
),
'multiple' => true,
)
);
$this->add_control(
'apply_settings',
array(
'label_block' => true,
'show_label' => false,
'type' => Controls_Manager::BUTTON,
'text' => esc_html__( 'Save & Reload', 'christian' ),
'event' => 'cmsmasters:theme_settings:apply_settings',
'separator' => 'before',
)
);
}
}