<?php

namespace SovereignStack\SecuritySafe;

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

// Run Policy
PolicyHideWPVersion::init();

/**
 * Class PolicyHideWPVersion
 *
 * @package SecuritySafe
 * @since   1.1.3
 */
final class PolicyHideWPVersion {

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

		// Remove Version From RSS
		add_filter( 'the_generator', [
			self::class,
			'rss_version',
		], 10, 0 );

		// Remove Generator Tag in HTML
		remove_action( 'wp_head', 'wp_generator' );
	}

	/**
	 * Remove WordPress Version From RSS
	 *
	 * @since  1.1.3
	 * @return string
	 *
	 */
	public static function rss_version(): string {

		return '';
	}
}
