FM

/home/u523506497/domains/mymelon.in/public_html/wp-includes UP

<?php
/**
 * Blocks API: WP_Block_Patterns_Registry class
 *
 * @package WordPress
 * @subpackage Blocks
 * @since 5.5.0
 */

/**
 * Class used for interacting with block patterns.
 *
 * @since 5.5.0
 */
#[AllowDynamicProperties]
final class WP_Block_Patterns_Registry {
	/**
	 * Registered block patterns array.
	 *
	 * @since 5.5.0
	 * @var array[]
	 */
	private $registered_patterns = array();

	/**
	 * Patterns registered outside the `init` action.
	 *
	 * @since 6.0.0
	 * @var array[]
	 */
	private $registered_patterns_outside_init = array();

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

	/**
	 * Registers a block pattern.
	 *
	 * @since 5.5.0
	 * @since 5.8.0 Added support for the `blockTypes` property.
	 * @since 6.1.0 Added support for the `postTypes` property.
	 * @since 6.2.0 Added support for the `templateTypes` property.
	 * @since 6.5.0 Added support for the `filePath` property.
	 *
	 * @param string $pattern_name       Block pattern name including namespace.
	 * @param array  $pattern_properties {
	 *     List of properties for the block pattern.
	 *
	 *     @type string   $title         Required. A human-readable title for the pattern.
	 *     @type string   $content       Optional. Block HTML markup for the pattern.
	 *                                   If not provided, the content will be retrieved from the `filePath` if set.
	 *                                   If both `content` and `filePath` are not set, the pattern will not be registered.
	 *     @type string   $description   Optional. Visually hidden text used to describe the pattern
	 *                                   in the inserter. A description is optional, but is strongly
	 *                                   encouraged when the title does not fully describe what the
	 *                                   pattern does. The description will help users discover the
	 *                                   pattern while searching.
	 *     @type int      $viewportWidth Optional. The intended width of the pattern to allow for a scaled
	 *                                   preview within the pattern inserter.
	 *     @type bool     $inserter      Optional. Determines whether the pattern is visible in inserter.
	 *                                   To hide a pattern so that it can only be inserted programmatically,
	 *                                   set this to false. Default true.
	 *     @type string[] $categories    Optional. A list of registered pattern categories used to group
	 *                                   block patterns. Block patterns can be shown on multiple categories.
	 *                                   A category must be registered separately in order to be used here.
	 *     @type string[] $keywords      Optional. A list of aliases or keywords that help users discover
	 *                                   the pattern while searching.
	 *     @type string[] $blockTypes    Optional. A list of block names including namespace that could use
	 *                                   the block pattern in certain contexts (placeholder, transforms).
	 *                                   The block pattern is available in the block editor inserter
	 *                                   regardless of this list of block names.
	 *                                   Certain blocks support further specificity besides the block name
	 *                                   (e.g. for `core/template-part` you can specify areas
	 *                                   like `core/template-part/header` or `core/template-part/footer`).
	 *     @type string[] $postTypes     Optional. An array of post types that the pattern is restricted
	 *                                   to be used with. The pattern will only be available when editing one
	 *                                   of the post types passed on the array. For all the other post types
	 *                                   not part of the array the pattern is not available at all.
	 *     @type string[] $templateTypes Optional. An array of template types where the pattern fits.
	 *     @type string   $filePath      Optional. The full path to the file containing the block pattern content.
	 * }
	 * @return bool True if the pattern was registered with success and false otherwise.
	 */
	public function register( $pattern_name, $pattern_properties ) {
		if ( ! isset( $pattern_name ) || ! is_string( $pattern_name ) ) {
			_doing_it_wrong(
				__METHOD__,
				__( 'Pattern name must be a string.' ),
				'5.5.0'
			);
			return false;
		}

		if ( ! isset( $pattern_properties['title'] ) || ! is_string( $pattern_properties['title'] ) ) {
			_doing_it_wrong(
				__METHOD__,
				__( 'Pattern title must be a string.' ),
				'5.5.0'
			);
			return false;
		}

		if ( ! isset( $pattern_properties['filePath'] ) ) {
			if ( ! isset( $pattern_properties['content'] ) || ! is_string( $pattern_properties['content'] ) ) {
				_doing_it_wrong(
					__METHOD__,
					__( 'Pattern content must be a string.' ),
					'5.5.0'
				);
				return false;
			}
		}

		$pattern = array_merge(
			$pattern_properties,
			array( 'name' => $pattern_name )
		);

		$this->registered_patterns[ $pattern_name ] = $pattern;

		// If the pattern is registered inside an action other than `init`, store it
		// also to a dedicated array. Used to detect deprecated registrations inside
		// `admin_init` or `current_screen`.
		if ( current_action() && 'init' !== current_action() ) {
			$this->registered_patterns_outside_init[ $pattern_name ] = $pattern;
		}

		return true;
	}

	/**
	 * Unregisters a block pattern.
	 *
	 * @since 5.5.0
	 *
	 * @param string $pattern_name Block pattern name including namespace.
	 * @return bool True if the pattern was unregistered with success and false otherwise.
	 */
	public function unregister( $pattern_name ) {
		if ( ! $this->is_registered( $pattern_name ) ) {
			_doing_it_wrong(
				__METHOD__,
				/* translators: %s: Pattern name. */
				sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ),
				'5.5.0'
			);
			return false;
		}

		unset( $this->registered_patterns[ $pattern_name ] );
		unset( $this->registered_patterns_outside_init[ $pattern_name ] );

		return true;
	}

	/**
	 * Retrieves the content of a registered block pattern.
	 *
	 * @since 6.5.0
	 *
	 * @param string $pattern_name      Block pattern name including namespace.
	 * @param bool   $outside_init_only Optional. Return only patterns registered outside the `init` action. Default false.
	 * @return string The content of the block pattern.
	 */
	private function get_content( $pattern_name, $outside_init_only = false ) {
		if ( $outside_init_only ) {
			$patterns = &$this->registered_patterns_outside_init;
		} else {
			$patterns = &$this->registered_patterns;
		}

		$file_path    = $patterns[ $pattern_name ]['filePath'] ?? '';
		$is_stringy   = is_string( $file_path ) || ( is_object( $file_path ) && method_exists( $file_path, '__toString' ) );
		$pattern_path = $is_stringy ? realpath( (string) $file_path ) : null;
		if (
			! isset( $patterns[ $pattern_name ]['content'] ) &&
			is_string( $pattern_path ) &&
			( str_ends_with( $pattern_path, '.php' ) || str_ends_with( $pattern_path, '.html' ) ) &&
			is_file( $pattern_path ) &&
			is_readable( $pattern_path )
		) {
			ob_start();
			include $patterns[ $pattern_name ]['filePath'];
			$patterns[ $pattern_name ]['content'] = ob_get_clean();
			unset( $patterns[ $pattern_name ]['filePath'] );
		}

		return $patterns[ $pattern_name ]['content'];
	}

	/**
	 * Retrieves an array containing the properties of a registered block pattern.
	 *
	 * @since 5.5.0
	 *
	 * @param string $pattern_name Block pattern name including namespace.
	 * @return array|null Registered pattern properties or `null` if the pattern is not registered.
	 */
	public function get_registered( $pattern_name ) {
		if ( ! $this->is_registered( $pattern_name ) ) {
			return null;
		}

		$pattern            = $this->registered_patterns[ $pattern_name ];
		$content            = $this->get_content( $pattern_name );
		$pattern['content'] = apply_block_hooks_to_content(
			$content,
			$pattern,
			'insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata'
		);

		return $pattern;
	}

	/**
	 * Retrieves all registered block patterns.
	 *
	 * @since 5.5.0
	 *
	 * @param bool $outside_init_only Return only patterns registered outside the `init` action.
	 * @return array[] Array of arrays containing the registered block patterns properties,
	 *                 and per style.
	 */
	public function get_all_registered( $outside_init_only = false ) {
		$patterns = $outside_init_only
			? $this->registered_patterns_outside_init
			: $this->registered_patterns;

		foreach ( $patterns as $index => $pattern ) {
			$content                       = $this->get_content( $pattern['name'], $outside_init_only );
			$patterns[ $index ]['content'] = apply_block_hooks_to_content(
				$content,
				$pattern,
				'insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata'
			);
		}

		return array_values( $patterns );
	}

	/**
	 * Checks if a block pattern is registered.
	 *
	 * @since 5.5.0
	 *
	 * @param string|null $pattern_name Block pattern name including namespace.
	 * @return bool True if the pattern is registered, false otherwise.
	 */
	public function is_registered( $pattern_name ) {
		return isset( $pattern_name, $this->registered_patterns[ $pattern_name ] );
	}

	public function __wakeup() {
		if ( ! $this->registered_patterns ) {
			return;
		}
		if ( ! is_array( $this->registered_patterns ) ) {
			throw new UnexpectedValueException();
		}
		foreach ( $this->registered_patterns as $value ) {
			if ( ! is_array( $value ) ) {
				throw new UnexpectedValueException();
			}
		}
		$this->registered_patterns_outside_init = array();
	}

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

		return self::$instance;
	}
}
ID3-
IXR-
PHPMailer-
Requests-
SimplePie-
Text-
abilities-api-
abilities-api.php32800V
abilities.php11797V
admin-bar.php40067V
ai-client-
ai-client.php2549V
assets-
atomlib.php12181V
author-template.php19844V
block-bindings-
block-bindings.php7632V
block-editor.php28724V
block-i18n.json316V
block-patterns-
block-patterns.php15606V
block-supports-
block-template-utils.php63477V
block-template.php18257V
blocks-
blocks.php124205V
bookmark-template.php12768V
bookmark.php15427V
build-
cache-compat.php11021V
cache.php13486V
canonical.php34786V
capabilities.php43584V
category-template.php56990V
category.php12834V
certificates-
class-IXR.php2609V
class-avif-info.php30008V
class-feed.php539V
class-http.php367V
class-json.php171V
class-oembed.php401V
class-phpass.php6771V
class-phpmailer.php664V
class-pop3.php171V
class-requests.php2237V
class-simplepie.php453V
class-smtp.php457V
class-snoopy.php37715V
class-spl.php171V
class-walker-category-dropdown.php2469V
class-walker-category.php8477V
class-walker-comment.php14221V
class-walker-nav-menu.php12044V
class-walker-page-dropdown.php2710V
class-walker-page.php7612V
class-wp-admin-bar.php18002V
class-wp-ajax-response.php5288V
class-wp-application-passwords.php17099V
class-wp-block-bindings-registry.php8263V
class-wp-block-bindings-source.php2992V
class-wp-block-editor-context.php1350V
class-wp-block-list.php4713V
class-wp-block-metadata-registry.php11846V
class-wp-block-parser-block.php2555V
class-wp-block-parser-frame.php1994V
class-wp-block-parser.php11525V
class-wp-block-pattern-categories-registry.php4383V
class-wp-block-patterns-registry.php10265V
class-wp-block-processor.php69914V
class-wp-block-styles-registry.php6419V
class-wp-block-supports.php7578V
class-wp-block-template.php2111V
class-wp-block-templates-registry.php7080V
class-wp-block-type-registry.php5305V
class-wp-block-type.php17222V
class-wp-block.php28236V
class-wp-classic-to-block-menu-converter.php4026V
class-wp-comment-query.php49040V
class-wp-comment.php17249V
class-wp-connector-registry.php15181V
class-wp-customize-control.php26112V
class-wp-customize-manager.php202908V
class-wp-customize-nav-menus.php58034V
class-wp-customize-panel.php10703V
class-wp-customize-section.php11209V
class-wp-customize-setting.php29956V
class-wp-customize-widgets.php72596V
class-wp-date-query.php35970V
class-wp-dependencies.php17089V
class-wp-dependency.php2653V
class-wp-duotone.php40836V
class-wp-editor.php72228V
class-wp-embed.php15908V
class-wp-error.php7514V
class-wp-exception.php253V
class-wp-fatal-error-handler.php8150V
class-wp-feed-cache-transient.php3304V
class-wp-feed-cache.php969V
class-wp-filter-sentinel.php760V
class-wp-hook.php17584V
class-wp-http-cookie.php7269V
class-wp-http-curl.php13261V
class-wp-http-encoding.php6689V
class-wp-http-ixr-client.php3516V
class-wp-http-proxy.php5980V
class-wp-http-requests-hooks.php2022V
class-wp-http-requests-response.php4243V
class-wp-http-response.php2977V
class-wp-http-streams.php16764V
class-wp-http.php41641V
class-wp-icon-collections-registry.php5805V
class-wp-icons-registry.php9903V
class-wp-image-editor-gd.php20741V
class-wp-image-editor-imagick.php43454V
class-wp-image-editor.php17456V
class-wp-list-util.php7443V
class-wp-locale-switcher.php6776V
class-wp-locale.php16848V
class-wp-matchesmapregex.php1828V
class-wp-meta-query.php30507V
class-wp-metadata-lazyloader.php6833V
class-wp-navigation-fallback.php9193V
class-wp-network-query.php19989V
class-wp-network.php12411V
class-wp-object-cache.php17524V
class-wp-oembed-controller.php6905V
class-wp-oembed.php34372V
class-wp-paused-extensions-storage.php5067V
class-wp-phpmailer.php4348V
class-wp-plugin-dependencies.php25209V
class-wp-post-type-variable.php0V
class-wp-post-type.php30672V
class-wp-post.php8806V
class-wp-query.php164148V
class-wp-recovery-mode-cookie-service.php6877V
class-wp-recovery-mode-email-service.php11162V
class-wp-recovery-mode-key-service.php4914V
class-wp-recovery-mode-link-service.php3523V
class-wp-recovery-mode.php11460V
class-wp-rewrite.php63693V
class-wp-role.php2523V
class-wp-roles.php9326V
class-wp-script-modules.php40743V
class-wp-scripts.php36754V
class-wp-session-tokens.php7319V
class-wp-simplepie-file.php3552V
class-wp-simplepie-sanitize-kses.php1903V
class-wp-site-query.php31482V
class-wp-site.php7836V
class-wp-speculation-rules.php7884V
class-wp-styles.php13316V
class-wp-tax-query.php19577V
class-wp-taxonomy.php18559V
class-wp-term-query.php40751V
class-wp-term.php5263V
class-wp-text-diff-renderer-inline.php979V
class-wp-text-diff-renderer-table.php18925V
class-wp-textdomain-registry.php10481V
class-wp-theme-json-data.php1805V
class-wp-theme-json-resolver.php35692V
class-wp-theme-json-schema.php7367V
class-wp-theme-json.php222059V
class-wp-theme.php65811V
class-wp-token-map.php29032V
class-wp-url-pattern-prefixer.php4802V
class-wp-user-meta-session-tokens.php2954V
class-wp-user-query.php44102V
class-wp-user-request.php2342V
class-wp-user.php23189V
class-wp-view-config-data.php29427V
class-wp-walker.php13292V
class-wp-widget-factory.php4113V
class-wp-widget.php18452V
class-wp-xmlrpc-server.php217288V
class-wp.php26520V
class-wpdb.php121437V
class.wp-dependencies.php373V
class.wp-scripts.php343V
class.wp-styles.php338V
comment-template.php103211V
comment.php150630V
compat-utf8.php19386V
compat.php22479V
connectors.php32922V
cron.php46266V
css-
customize-
date.php400V
default-constants.php11365V
default-filters.php39500V
default-widgets.php2288V
deprecated.php193977V
embed-template.php338V
embed.php39215V
error-protection.php4092V
feed-atom-comments.php5504V
feed-atom.php3114V
feed-rdf.php2668V
feed-rss-core.php146V
feed-rss.php1189V
feed-rss2-comments.php4136V
feed-rss2.php3799V
feed.php25189V
fonts-
fonts.php9789V
formatting.php357678V
functions.php295481V
functions.wp-scripts.php20492V
functions.wp-styles.php8654V
general-template-get.php146V
general-template.php184198V
global-styles-and-settings.php20780V
html-api-
http.php28961V
https-detection.php5857V
https-migration.php4741V
icons.php6334V
images-
interactivity-api-
js-
json-schema.php7802V
kses.php88497V
l10n-
l10n.php71415V
link-template.php160143V
load.php56475V
locale.php162V
media-template.php65759V
media.php236804V
meta.php66739V
ms-blogs.php26324V
ms-default-constants.php4921V
ms-default-filters.php6636V
ms-deprecated.php21787V
ms-files.php2857V
ms-functions.php92530V
ms-load.php20055V
ms-network.php3782V
ms-settings.php4197V
ms-site.php41729V
nav-menu-template.php25983V
nav-menu.php44269V
option.php105246V
php-ai-client-
php-compat-
pluggable-deprecated.php6324V
pluggable.php127919V
plugin.php37123V
pomo-
post-formats.php7070V
post-template.php69129V
post-thumbnail-template.php10879V
post.php305215V
query.php37554V
registration-functions.php200V
registration.php200V
rest-api-
rest-api.php102951V
revision.php31241V
rewrite.php19567V
robots-template.php5185V
rss-functions.php277V
rss.php23203V
script-loader.php163550V
script-modules.php12311V
session.php258V
shortcodes-set.php0V
shortcodes.php24034V
sitemaps-
sitemaps.php3238V
sodium_compat-
speculative-loading.php11880V
spl-autoload-compat.php441V
style-engine-
style-engine.php8045V
taxonomy.php178307V
template-canvas.php544V
template-loader.php4267V
template.php38826V
theme-compat-
theme-i18n.json1892V
theme-previews.php2887V
theme-templates.php4060V
theme.json9480V
theme.php134913V
update.php38269V
user.php180301V
utf8.php6977V
vars.php6600V
version.php1103V
view-config.php19087V
view-transitions.php602V
widgets-
widgets.php70866V
wp-db.php445V
wp-diff.php792V
About - My Melon - Digital Marketing & Creative Agency
Skip to content Skip to footer
MyMelon About Us

Making You Do Impossible Things

WHO WE ARE

Avowed for being experimental, social, and digital, we are a team of young marketers focused on fetching out-of-the-box solutions to complex problems. 

Driven by creativity, we are a force to help you avoid the hassles of running a successful business.

We give our clients quick access to the success ladder through a variety of ways depending upon their appetite! 

Disruptive Marketers for your big idea 

We bring in awesomesauce resolutions that’ll blow your mind

Creativity Over Knowledge

Combining existing knowledge and perceptions like no one ever thought to generate unique insights and solutions.

Better Together

Our crazy passionate team is self-starters and go-getters. Believing in the power of combining a spectrum of perspectives, we bring every idea to the spotlight. 

GET SET GO

We help you grow quick, and by quick we mean really quick like when you have your first cakewalk. 

Ready to rock and roll?