Server IP : 172.67.157.199 / Your IP : 3.133.113.64 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/themes/CubicWP/inc/admin/options/ |
Upload File : |
<?php /** * Page options * * @package ListMode WordPress Theme * @copyright Copyright (C) 2024 ThemesDNA * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later * @author ThemesDNA <[email protected]> */ function listmode_page_options($wp_customize) { $panel_id = 'listmode_main_options_panel'; $priority = 190; $wp_customize->add_section( 'listmode_section_page', array( 'title' => esc_html__('Page Options', 'listmode'), 'panel' => $panel_id, 'priority' => $priority, ) ); $listmode_options = array( 'thumbnail_link_page' => array( 'default' => 'yes', 'sanitize_callback' => 'listmode_sanitize_thumbnail_link', 'control_label' => esc_html__('Featured Image Link', 'listmode'), 'control_description' => esc_html__('Do you want the featured image in a page to be linked to its page?', 'listmode'), 'control_type' => 'select', 'choices' => array('yes' => esc_html__('Yes', 'listmode'), 'no' => esc_html__('No', 'listmode')), ), 'hide_thumbnail_page' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Featured Image from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'hide_page_title' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Page Header from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'remove_page_title_link' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Remove Link from Single Page Titles', 'listmode'), 'control_type' => 'checkbox', ), 'hide_page_date' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Page Date from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'page_date_type' => array( 'default' => 'published', 'sanitize_callback' => 'listmode_sanitize_date_type', 'control_label' => esc_html__('Page Date Type', 'listmode'), 'control_description' => esc_html__('You can choose to display published or updated date on your page.', 'listmode'), 'control_type' => 'select', 'choices' => array('published' => esc_html__('Published', 'listmode'), 'updated' => esc_html__('Updated', 'listmode')), ), 'hide_page_author' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Page Author from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'hide_page_comments' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Comment Link from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'hide_page_comment_form' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Comments/Comment Form from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'hide_page_edit' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Edit Link from Single Pages', 'listmode'), 'control_type' => 'checkbox', ), 'hide_static_page_title' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Page Header from Static Homepage', 'listmode'), 'control_type' => 'checkbox', ), 'hide_static_page_meta' => array( 'default' => false, 'sanitize_callback' => 'listmode_sanitize_checkbox', 'control_label' => esc_html__('Hide Page Meta Data (Page Date, Page Author, Comment Link) from Static Homepage', 'listmode'), 'control_type' => 'checkbox', ), ); foreach ($listmode_options as $option_name => $option_args) { $wp_customize->add_setting("listmode_options[{$option_name}]", array( 'default' => isset($option_args['default']) ? $option_args['default'] : '', 'type' => isset($option_args['type']) ? $option_args['type'] : 'option', 'capability' => isset($option_args['capability']) ? $option_args['capability'] : 'edit_theme_options', 'sanitize_callback' => isset($option_args['sanitize_callback']) ? $option_args['sanitize_callback'] : '', ) ); $wp_customize->add_control("listmode_{$option_name}_control", array( 'label' => isset($option_args['control_label']) ? $option_args['control_label'] : '', 'section' => 'listmode_section_page', 'settings' => "listmode_options[{$option_name}]", 'type' => isset($option_args['control_type']) ? $option_args['control_type'] : 'text', 'description' => isset($option_args['control_description']) ? $option_args['control_description'] : '', 'choices' => (isset($option_args['choices']) ? $option_args['choices'] : array()), 'priority' => isset($option_args['control_priority']) ? $option_args['control_priority'] : 10, ) ); } }