<?php
/**
 * Custom Post Author Class
 *
 * @package errigal
 * @since 1.1.0
 */

namespace Errigal\Customiser;

defined( 'ABSPATH' ) || exit;

/**
 * This class is in charge of providing post author settings and functions.
 *
 * @since 1.1.0
 */
class Errigal_Custom_Post_Author extends Errigal_Custom_Base {
	/**
	 * Setting ID: Label: Post author.
	 *
	 * @since 1.1.0
	 *
	 * @var string
	 */
	public const ID_LABEL_POST_AUTHOR = 'post_author_label';

	/**
	 * Setting ID: Post author.
	 *
	 * @since 1.1.0
	 *
	 * @var string
	 */
	public const ID_POST_AUTHOR = 'post_author';

	/**
	 * Default setting value: Post author.
	 *
	 * @since 1.1.0
	 *
	 * @var bool
	 */
	public const DEFAULT_POST_AUTHOR = self::CAN_SHOW;

	/**
	 * Indicates post author can be displayed.
	 *
	 * @since 1.2.0
	 *
	 * @var bool
	 */
	private const CAN_SHOW = true;

	/**
	 * Determines whether post author can be displayed.
	 *
	 * @since 1.1.0
	 *
	 * @return bool
	 */
	public static function can_show() {
		return self::get_theme_mod_bool(
			self::ID_POST_AUTHOR,
			self::DEFAULT_POST_AUTHOR
		);
	}
}
