Your IP : 216.73.216.1
<?php
/**
* Page Options
*
* @package pally
* @since 1.0.0
*/
namespace Pally;
use WP_Customize_Manager;
/**
* Page Options
*
* @since 1.0.0
*/
class Page_Options {
/**
* Constructor.
*
* @since 1.0.0
* @access public
*/
public function __construct() {
add_action( 'customize_register', [ $this, 'action_register_customizer_control' ] );
}
/**
* Adds a Customizer setting and control
*
* @param WP_Customize_Manager $wp_customize Customizer manager instance.
*/
public function action_register_customizer_control( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_section(
'page_options',
[
'title' => __( 'Page options', 'pally' ),
'panel' => 'theme_options',
'priority' => 5,
]
);
$wp_customize->add_setting(
'page_hide_title',
[
'default' => false,
'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
]
);
$wp_customize->add_control(
'page_hide_title',
[
'type' => 'checkbox',
'label' => __( 'Visually hide Page Title on Homepage', 'pally' ),
'description' => __( 'Hide the page title when the page is set as the homepage (will still be there for Screenreaders and search engines)', 'pally' ),
'section' => 'page_options',
]
);
}
}