Your IP : 216.73.216.1


Current Path : /home/fotouserdopd8j/agenciacrabli.com/wp-contentn/themes/pally/inc/classes/
Upload File :
Current File : /home/fotouserdopd8j/agenciacrabli.com/wp-contentn/themes/pally/inc/classes/Post_Options.php

<?php
/**
 * Post Options
 *
 * @package pally
 * @since 1.0.0
 */

namespace Pally;

use WP_Customize_Manager;

/**
 * Post Options
 *
 * @since 1.0.0
 */
class Post_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(
			'post_options',
			array(
				'title'    => __( 'Post options', 'pally' ),
				'panel'    => 'theme_options',
				'priority' => 4,
			)
		);



		$wp_customize->add_setting(
			'show_author',
			array(
				'default'           => true,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_author',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show author name', 'pally' ),
				'description' => __( 'Show or hide the author name', 'pally' ),
				'section'     => 'post_options',
			)
		);

		$wp_customize->selective_refresh->add_partial(
			'show_author',
			array(
				'selector' => '.type-post .posted-by',
			)
		);

		$wp_customize->add_setting(
			'show_date',
			array(
				'default'           => true,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_date',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show publishing date', 'pally' ),
				'description' => __( 'Show or hide the publishing date', 'pally' ),
				'section'     => 'post_options',
			)
		);




		$wp_customize->add_setting(
			'show_categories',
			array(
				'default'           => true,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_categories',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show categories', 'pally' ),
				'description' => __( 'Show or hide the categories', 'pally' ),
				'section'     => 'post_options',
			)
		);

		$wp_customize->selective_refresh->add_partial(
			'show_categories',
			array(
				'selector' => '.single .type-post .entry-meta',
			)
		);

		$wp_customize->add_setting(
			'show_tags',
			array(
				'default'           => false,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_tags',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show tags', 'pally' ),
				'description' => __( 'Show or hide the tags', 'pally' ),
				'section'     => 'post_options',
			)
		);

		$wp_customize->add_setting(
			'show_navigation_text',
			array(
				'default'           => true,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_navigation_text',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show Navigation Text', 'pally' ),
				'description' => __( 'Show or hide the Next: & Previous: text for the post navigation', 'pally' ),
				'section'     => 'post_options',
			)
		);

		$wp_customize->add_setting(
			'show_post_thumbnail',
			array(
				'default'           => true,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_post_thumbnail',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show Post thumbnail', 'pally' ),
				'description' => __( 'Shows the post thumbnail on posts (after the title) on the blog roll', 'pally' ),
				'section'     => 'post_options',
			)
		);

		$wp_customize->add_setting(
			'show_post_thumbnail_post',
			array(
				'default'           => true,
				'sanitize_callback' => 'Pally\Customizer::sanitize_checkbox',
			)
		);

		$wp_customize->add_control(
			'show_post_thumbnail_post',
			array(
				'type'        => 'checkbox',
				'label'       => __( 'Show Post thumbnail on post', 'pally' ),
				'description' => __( 'Shows the post thumbnail (after the title) on post pages', 'pally' ),
				'section'     => 'post_options',
			)
		);

	}



}