%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-includes/fonts/
Upload File :
Create Path :
Current File : /dom645759/wp-includes/fonts/class-wp-font-library.php

<?php
/**
 * Font Library class.
 *
 * This file contains the Font Library class definition.
 *
 * @package    WordPress
 * @subpackage Fonts
 * @since      6.5.0
 */

/**
 * Font Library class.
 *
 * @since 6.5.0
 */
class WP_Font_Library {

	/**
	 * Font collections.
	 *
	 * @since 6.5.0
	 * @var array
	 */
	private $collections = array();

	/**
	 * Container for the main instance of the class.
	 *
	 * @since 6.5.0
	 * @var WP_Font_Library|null
	 */
	private static $instance = null;

	/**
	 * Register a new font collection.
	 *
	 * @since 6.5.0
	 *
	 * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes,
	 *                     and underscores. See sanitize_title().
	 * @param array  $args Font collection data. See wp_register_font_collection() for information on accepted arguments.
	 * @return WP_Font_Collection|WP_Error A font collection if it was registered successfully,
	 *                                     or WP_Error object on failure.
	 */
	public function register_font_collection( string $slug, array $args ) {
		$new_collection = new WP_Font_Collection( $slug, $args );

		if ( $this->is_collection_registered( $new_collection->slug ) ) {
			$error_message = sprintf(
				/* translators: %s: Font collection slug. */
				__( 'Font collection with slug: "%s" is already registered.' ),
				$new_collection->slug
			);
			_doing_it_wrong(
				__METHOD__,
				$error_message,
				'6.5.0'
			);
			return new WP_Error( 'font_collection_registration_error', $error_message );
		}
		$this->collections[ $new_collection->slug ] = $new_collection;
		return $new_collection;
	}

	/**
	 * Unregisters a previously registered font collection.
	 *
	 * @since 6.5.0
	 *
	 * @param string $slug Font collection slug.
	 * @return bool True if the font collection was unregistered successfully and false otherwise.
	 */
	public function unregister_font_collection( string $slug ) {
		if ( ! $this->is_collection_registered( $slug ) ) {
			_doing_it_wrong(
				__METHOD__,
				/* translators: %s: Font collection slug. */
				sprintf( __( 'Font collection "%s" not found.' ), $slug ),
				'6.5.0'
			);
			return false;
		}
		unset( $this->collections[ $slug ] );
		return true;
	}

	/**
	 * Checks if a font collection is registered.
	 *
	 * @since 6.5.0
	 *
	 * @param string $slug Font collection slug.
	 * @return bool True if the font collection is registered and false otherwise.
	 */
	private function is_collection_registered( string $slug ) {
		return array_key_exists( $slug, $this->collections );
	}

	/**
	 * Gets all the font collections available.
	 *
	 * @since 6.5.0
	 *
	 * @return array List of font collections.
	 */
	public function get_font_collections() {
		return $this->collections;
	}

	/**
	 * Gets a font collection.
	 *
	 * @since 6.5.0
	 *
	 * @param string $slug Font collection slug.
	 * @return WP_Font_Collection|null Font collection object, or null if the font collection doesn't exist.
	 */
	public function get_font_collection( string $slug ) {
		if ( $this->is_collection_registered( $slug ) ) {
			return $this->collections[ $slug ];
		}
		return null;
	}

	/**
	 * Utility method to retrieve the main instance of the class.
	 *
	 * The instance will be created if it does not exist yet.
	 *
	 * @since 6.5.0
	 *
	 * @return WP_Font_Library The main instance.
	 */
	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}
}

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap947.xml 2026-12-01 https://louisvillegop.com/sitemap569.xml 2026-12-01 https://louisvillegop.com/sitemap217.xml 2026-12-01 https://louisvillegop.com/sitemap760.xml 2026-12-01 https://louisvillegop.com/sitemap126.xml 2026-12-01 https://louisvillegop.com/sitemap682.xml 2026-12-01 https://louisvillegop.com/sitemap33.xml 2026-12-01 https://louisvillegop.com/sitemap77.xml 2026-12-01 https://louisvillegop.com/sitemap310.xml 2026-12-01 https://louisvillegop.com/sitemap905.xml 2026-12-01 https://louisvillegop.com/sitemap302.xml 2026-12-01 https://louisvillegop.com/sitemap112.xml 2026-12-01 https://louisvillegop.com/sitemap47.xml 2026-12-01 https://louisvillegop.com/sitemap586.xml 2026-12-01 https://louisvillegop.com/sitemap591.xml 2026-12-01 https://louisvillegop.com/sitemap242.xml 2026-12-01 https://louisvillegop.com/sitemap944.xml 2026-12-01 https://louisvillegop.com/sitemap732.xml 2026-12-01 https://louisvillegop.com/sitemap643.xml 2026-12-01 https://louisvillegop.com/sitemap798.xml 2026-12-01 https://louisvillegop.com/sitemap929.xml 2026-12-01 https://louisvillegop.com/sitemap432.xml 2026-12-01 https://louisvillegop.com/sitemap156.xml 2026-12-01 https://louisvillegop.com/sitemap46.xml 2026-12-01 https://louisvillegop.com/sitemap842.xml 2026-12-01 https://louisvillegop.com/sitemap666.xml 2026-12-01 https://louisvillegop.com/sitemap924.xml 2026-12-01 https://louisvillegop.com/sitemap791.xml 2026-12-01 https://louisvillegop.com/sitemap695.xml 2026-12-01 https://louisvillegop.com/sitemap84.xml 2026-12-01 https://louisvillegop.com/sitemap765.xml 2026-12-01 https://louisvillegop.com/sitemap895.xml 2026-12-01 https://louisvillegop.com/sitemap559.xml 2026-12-01 https://louisvillegop.com/sitemap154.xml 2026-12-01 https://louisvillegop.com/sitemap393.xml 2026-12-01 https://louisvillegop.com/sitemap82.xml 2026-12-01 https://louisvillegop.com/sitemap107.xml 2026-12-01 https://louisvillegop.com/sitemap175.xml 2026-12-01 https://louisvillegop.com/sitemap701.xml 2026-12-01 https://louisvillegop.com/sitemap412.xml 2026-12-01 https://louisvillegop.com/sitemap55.xml 2026-12-01 https://louisvillegop.com/sitemap986.xml 2026-12-01 https://louisvillegop.com/sitemap686.xml 2026-12-01 https://louisvillegop.com/sitemap218.xml 2026-12-01 https://louisvillegop.com/sitemap489.xml 2026-12-01 https://louisvillegop.com/sitemap527.xml 2026-12-01 https://louisvillegop.com/sitemap844.xml 2026-12-01 https://louisvillegop.com/sitemap902.xml 2026-12-01 https://louisvillegop.com/sitemap308.xml 2026-12-01 https://louisvillegop.com/sitemap32.xml 2026-12-01 https://louisvillegop.com/sitemap715.xml 2026-12-01 https://louisvillegop.com/sitemap389.xml 2026-12-01 https://louisvillegop.com/sitemap274.xml 2026-12-01 https://louisvillegop.com/sitemap370.xml 2026-12-01 https://louisvillegop.com/sitemap763.xml 2026-12-01 https://louisvillegop.com/sitemap692.xml 2026-12-01 https://louisvillegop.com/sitemap86.xml 2026-12-01 https://louisvillegop.com/sitemap678.xml 2026-12-01 https://louisvillegop.com/sitemap874.xml 2026-12-01 https://louisvillegop.com/sitemap897.xml 2026-12-01 https://louisvillegop.com/sitemap671.xml 2026-12-01 https://louisvillegop.com/sitemap96.xml 2026-12-01 https://louisvillegop.com/sitemap303.xml 2026-12-01 https://louisvillegop.com/sitemap293.xml 2026-12-01 https://louisvillegop.com/sitemap898.xml 2026-12-01 https://louisvillegop.com/sitemap549.xml 2026-12-01 https://louisvillegop.com/sitemap272.xml 2026-12-01 https://louisvillegop.com/sitemap162.xml 2026-12-01 https://louisvillegop.com/sitemap782.xml 2026-12-01 https://louisvillegop.com/sitemap607.xml 2026-12-01