<?php

namespace SovereignStack\SecuritySafe;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

// Run Policy
PolicyHideWPVersionAdmin::init();

/**
 * Class PolicyHideWPVersionAdmin
 *
 * @package SecuritySafe
 * @since   1.2.0
 */
final class PolicyHideWPVersionAdmin {

	/**
	 * Register hooks
	 *
	 * @return void
	 */
	public static function init(): void {

		// Update footer
		add_action( 'admin_init', [
			self::class,
			'update_footer',
		] );
	}

	/**
	 * Update WordPress Admin Footer Version
	 *
	 * @since  1.2.0
	 */
	public static function update_footer(): void {

		add_filter( 'admin_footer_text', [
			self::class,
			'custom_footer',
		], 11, 0 );
		add_filter( 'update_footer', '__return_false', 11 );
	}

	/**
	 * Set a custom string value for the footer
	 *
	 * @since  1.2.0
	 * @return string
	 *
	 */
	public static function custom_footer(): string {

		// @todo Will add the ability to customize this in the future.

		return '';
	}
}
