FM /home/u523506497/domains/mymelon.in/public_html/wp-includes UP
<?php
/**
* Register the block patterns and block patterns categories
*
* @package WordPress
* @since 5.5.0
*/
add_theme_support( 'core-block-patterns' );
/**
* Registers a new block pattern.
*
* @since 5.5.0
*
* @param string $pattern_name Block pattern name including namespace.
* @param array $pattern_properties List of properties for the block pattern.
* See WP_Block_Patterns_Registry::register() for accepted arguments.
* @return bool True if the pattern was registered with success and false otherwise.
*/
function register_block_pattern( $pattern_name, $pattern_properties ) {
return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties );
}
/**
* 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.
*/
function unregister_block_pattern( $pattern_name ) {
return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name );
}
/**
* Registers a new pattern category.
*
* @since 5.5.0
*
* @param string $category_name Pattern category name including namespace.
* @param array $category_properties List of properties for the block pattern.
* See WP_Block_Pattern_Categories_Registry::register() for
* accepted arguments.
* @return bool True if the pattern category was registered with success and false otherwise.
*/
function register_block_pattern_category( $category_name, $category_properties ) {
return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );
}
/**
* Unregisters a pattern category.
*
* @since 5.5.0
*
* @param string $category_name Pattern category name including namespace.
* @return bool True if the pattern category was unregistered with success and false otherwise.
*/
function unregister_block_pattern_category( $category_name ) {
return WP_Block_Pattern_Categories_Registry::get_instance()->unregister( $category_name );
}
/**
* Registers the core block patterns and categories.
*
* @since 5.5.0
* @since 6.3.0 Added source to core block patterns.
* @access private
*/
function _register_core_block_patterns_and_categories() {
$should_register_core_patterns = get_theme_support( 'core-block-patterns' );
if ( $should_register_core_patterns ) {
$core_block_patterns = array(
'query-standard-posts',
'query-medium-posts',
'query-small-posts',
'query-grid-posts',
'query-large-title-posts',
'query-offset-posts',
'navigation-overlay',
'navigation-overlay-black-bg',
'navigation-overlay-accent-bg',
'navigation-overlay-centered',
'navigation-overlay-centered-with-extras',
);
foreach ( $core_block_patterns as $core_block_pattern ) {
$pattern = require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php';
$pattern['source'] = 'core';
register_block_pattern( 'core/' . $core_block_pattern, $pattern );
}
}
register_block_pattern_category(
'banner',
array(
'label' => _x( 'Banners', 'Block pattern category' ),
'description' => __( 'Bold sections designed to showcase key content.' ),
)
);
register_block_pattern_category(
'buttons',
array(
'label' => _x( 'Buttons', 'Block pattern category' ),
'description' => __( 'Patterns that contain buttons and call to actions.' ),
)
);
register_block_pattern_category(
'columns',
array(
'label' => _x( 'Columns', 'Block pattern category' ),
'description' => __( 'Multi-column patterns with more complex layouts.' ),
)
);
register_block_pattern_category(
'text',
array(
'label' => _x( 'Text', 'Block pattern category' ),
'description' => __( 'Patterns containing mostly text.' ),
)
);
register_block_pattern_category(
'query',
array(
'label' => _x( 'Posts', 'Block pattern category' ),
'description' => __( 'Display your latest posts in lists, grids or other layouts.' ),
)
);
register_block_pattern_category(
'featured',
array(
'label' => _x( 'Featured', 'Block pattern category' ),
'description' => __( 'A set of high quality curated patterns.' ),
)
);
register_block_pattern_category(
'call-to-action',
array(
'label' => _x( 'Call to action', 'Block pattern category' ),
'description' => __( 'Sections whose purpose is to trigger a specific action.' ),
)
);
register_block_pattern_category(
'team',
array(
'label' => _x( 'Team', 'Block pattern category' ),
'description' => __( 'A variety of designs to display your team members.' ),
)
);
register_block_pattern_category(
'testimonials',
array(
'label' => _x( 'Testimonials', 'Block pattern category' ),
'description' => __( 'Share reviews and feedback about your brand/business.' ),
)
);
register_block_pattern_category(
'services',
array(
'label' => _x( 'Services', 'Block pattern category' ),
'description' => __( 'Briefly describe what your business does and how you can help.' ),
)
);
register_block_pattern_category(
'contact',
array(
'label' => _x( 'Contact', 'Block pattern category' ),
'description' => __( 'Display your contact information.' ),
)
);
register_block_pattern_category(
'about',
array(
'label' => _x( 'About', 'Block pattern category' ),
'description' => __( 'Introduce yourself.' ),
)
);
register_block_pattern_category(
'portfolio',
array(
'label' => _x( 'Portfolio', 'Block pattern category' ),
'description' => __( 'Showcase your latest work.' ),
)
);
register_block_pattern_category(
'gallery',
array(
'label' => _x( 'Gallery', 'Block pattern category' ),
'description' => __( 'Different layouts for displaying images.' ),
)
);
register_block_pattern_category(
'media',
array(
'label' => _x( 'Media', 'Block pattern category' ),
'description' => __( 'Different layouts containing video or audio.' ),
)
);
register_block_pattern_category(
'videos',
array(
'label' => _x( 'Videos', 'Block pattern category' ),
'description' => __( 'Different layouts containing videos.' ),
)
);
register_block_pattern_category(
'audio',
array(
'label' => _x( 'Audio', 'Block pattern category' ),
'description' => __( 'Different layouts containing audio.' ),
)
);
register_block_pattern_category(
'posts',
array(
'label' => _x( 'Posts', 'Block pattern category' ),
'description' => __( 'Display your latest posts in lists, grids or other layouts.' ),
)
);
register_block_pattern_category(
'footer',
array(
'label' => _x( 'Footers', 'Block pattern category' ),
'description' => __( 'A variety of footer designs displaying information and site navigation.' ),
)
);
register_block_pattern_category(
'header',
array(
'label' => _x( 'Headers', 'Block pattern category' ),
'description' => __( 'A variety of header designs displaying your site title and navigation.' ),
)
);
register_block_pattern_category(
'navigation',
array(
'label' => _x( 'Navigation', 'Block pattern category' ),
'description' => __( 'A variety of designs displaying site navigation.' ),
)
);
}
/**
* Normalize the pattern properties to camelCase.
*
* The API's format is snake_case, `register_block_pattern()` expects camelCase.
*
* @since 6.2.0
* @access private
*
* @param array $pattern Pattern as returned from the Pattern Directory API.
* @return array Normalized pattern.
*/
function wp_normalize_remote_block_pattern( $pattern ) {
if ( isset( $pattern['block_types'] ) ) {
$pattern['blockTypes'] = $pattern['block_types'];
unset( $pattern['block_types'] );
}
if ( isset( $pattern['viewport_width'] ) ) {
$pattern['viewportWidth'] = $pattern['viewport_width'];
unset( $pattern['viewport_width'] );
}
return (array) $pattern;
}
/**
* Register Core's official patterns from wordpress.org/patterns.
*
* @since 5.8.0
* @since 5.9.0 The $current_screen argument was removed.
* @since 6.2.0 Normalize the pattern from the API (snake_case) to the
* format expected by `register_block_pattern` (camelCase).
* @since 6.3.0 Add 'pattern-directory/core' to the pattern's 'source'.
*
* @param WP_Screen $deprecated Unused. Formerly the screen that the current request was triggered from.
*/
function _load_remote_block_patterns( $deprecated = null ) {
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '5.9.0' );
$current_screen = $deprecated;
if ( ! $current_screen->is_block_editor ) {
return;
}
}
$supports_core_patterns = get_theme_support( 'core-block-patterns' );
/**
* Filter to disable remote block patterns.
*
* @since 5.8.0
*
* @param bool $should_load_remote
*/
$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
if ( $supports_core_patterns && $should_load_remote ) {
$request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
$core_keyword_id = 11; // 11 is the ID for "core".
$request->set_param( 'keyword', $core_keyword_id );
$response = rest_do_request( $request );
if ( $response->is_error() ) {
return;
}
$patterns = $response->get_data();
foreach ( $patterns as $pattern ) {
$pattern['source'] = 'pattern-directory/core';
$normalized_pattern = wp_normalize_remote_block_pattern( $pattern );
$pattern_name = 'core/' . sanitize_title( $normalized_pattern['title'] );
register_block_pattern( $pattern_name, $normalized_pattern );
}
}
}
/**
* Register `Featured` (category) patterns from wordpress.org/patterns.
*
* @since 5.9.0
* @since 6.2.0 Normalized the pattern from the API (snake_case) to the
* format expected by `register_block_pattern()` (camelCase).
* @since 6.3.0 Add 'pattern-directory/featured' to the pattern's 'source'.
*/
function _load_remote_featured_patterns() {
$supports_core_patterns = get_theme_support( 'core-block-patterns' );
/** This filter is documented in wp-includes/block-patterns.php */
$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
if ( ! $should_load_remote || ! $supports_core_patterns ) {
return;
}
$request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
$featured_cat_id = 26; // This is the `Featured` category id from pattern directory.
$request->set_param( 'category', $featured_cat_id );
$response = rest_do_request( $request );
if ( $response->is_error() ) {
return;
}
$patterns = $response->get_data();
$registry = WP_Block_Patterns_Registry::get_instance();
foreach ( $patterns as $pattern ) {
$pattern['source'] = 'pattern-directory/featured';
$normalized_pattern = wp_normalize_remote_block_pattern( $pattern );
$pattern_name = sanitize_title( $normalized_pattern['title'] );
// Some patterns might be already registered as core patterns with the `core` prefix.
$is_registered = $registry->is_registered( $pattern_name ) || $registry->is_registered( "core/$pattern_name" );
if ( ! $is_registered ) {
register_block_pattern( $pattern_name, $normalized_pattern );
}
}
}
/**
* Registers patterns from Pattern Directory provided by a theme's
* `theme.json` file.
*
* @since 6.0.0
* @since 6.2.0 Normalized the pattern from the API (snake_case) to the
* format expected by `register_block_pattern()` (camelCase).
* @since 6.3.0 Add 'pattern-directory/theme' to the pattern's 'source'.
* @access private
*/
function _register_remote_theme_patterns() {
/** This filter is documented in wp-includes/block-patterns.php */
if ( ! apply_filters( 'should_load_remote_block_patterns', true ) ) {
return;
}
if ( ! wp_theme_has_theme_json() ) {
return;
}
$pattern_settings = wp_get_theme_directory_pattern_slugs();
if ( empty( $pattern_settings ) ) {
return;
}
$request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
$request['slug'] = $pattern_settings;
$response = rest_do_request( $request );
if ( $response->is_error() ) {
return;
}
$patterns = $response->get_data();
$patterns_registry = WP_Block_Patterns_Registry::get_instance();
foreach ( $patterns as $pattern ) {
$pattern['source'] = 'pattern-directory/theme';
$normalized_pattern = wp_normalize_remote_block_pattern( $pattern );
$pattern_name = sanitize_title( $normalized_pattern['title'] );
// Some patterns might be already registered as core patterns with the `core` prefix.
$is_registered = $patterns_registry->is_registered( $pattern_name ) || $patterns_registry->is_registered( "core/$pattern_name" );
if ( ! $is_registered ) {
register_block_pattern( $pattern_name, $normalized_pattern );
}
}
}
/**
* Register any patterns that the active theme may provide under its
* `./patterns/` directory.
*
* @since 6.0.0
* @since 6.1.0 The `postTypes` property was added.
* @since 6.2.0 The `templateTypes` property was added.
* @since 6.4.0 Uses the `WP_Theme::get_block_patterns` method.
* @access private
*/
function _register_theme_block_patterns() {
/*
* During the bootstrap process, a check for active and valid themes is run.
* If no themes are returned, the theme's functions.php file will not be loaded,
* which can lead to errors if patterns expect some variables or constants to
* already be set at this point, so bail early if that is the case.
*/
if ( empty( wp_get_active_and_valid_themes() ) ) {
return;
}
/*
* Register patterns for the active theme. If the theme is a child theme,
* let it override any patterns from the parent theme that shares the same slug.
*/
$themes = array();
$theme = wp_get_theme();
$themes[] = $theme;
if ( $theme->parent() ) {
$themes[] = $theme->parent();
}
$registry = WP_Block_Patterns_Registry::get_instance();
foreach ( $themes as $theme ) {
$patterns = $theme->get_block_patterns();
$dirpath = $theme->get_stylesheet_directory() . '/patterns/';
$text_domain = $theme->get( 'TextDomain' );
foreach ( $patterns as $file => $pattern_data ) {
if ( $registry->is_registered( $pattern_data['slug'] ) ) {
continue;
}
$file_path = $dirpath . $file;
if ( ! file_exists( $file_path ) ) {
_doing_it_wrong(
__FUNCTION__,
sprintf(
/* translators: %s: file name. */
__( 'Could not register file "%s" as a block pattern as the file does not exist.' ),
$file
),
'6.4.0'
);
$theme->delete_pattern_cache();
continue;
}
$pattern_data['filePath'] = $file_path;
// Translate the pattern metadata.
// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain,WordPress.WP.I18n.LowLevelTranslationFunction
$pattern_data['title'] = translate_with_gettext_context( $pattern_data['title'], 'Pattern title', $text_domain );
if ( ! empty( $pattern_data['description'] ) ) {
// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain,WordPress.WP.I18n.LowLevelTranslationFunction
$pattern_data['description'] = translate_with_gettext_context( $pattern_data['description'], 'Pattern description', $text_domain );
}
register_block_pattern( $pattern_data['slug'], $pattern_data );
}
}
}
add_action( 'init', '_register_theme_block_patterns' );
ID3 - IXR - PHPMailer - Requests - SimplePie - Text - abilities-api - abilities-api.php 32800 V abilities.php 11797 V admin-bar.php 40067 V ai-client - ai-client.php 2549 V assets - atomlib.php 12181 V author-template.php 19844 V block-bindings - block-bindings.php 7632 V block-editor.php 28724 V block-i18n.json 316 V block-patterns - block-patterns.php 15606 V block-supports - block-template-utils.php 63477 V block-template.php 18257 V blocks - blocks.php 124205 V bookmark-template.php 12768 V bookmark.php 15427 V build - cache-compat.php 11021 V cache.php 13486 V canonical.php 34786 V capabilities.php 43584 V category-template.php 56990 V category.php 12834 V certificates - class-IXR.php 2609 V class-avif-info.php 30008 V class-feed.php 539 V class-http.php 367 V class-json.php 171 V class-oembed.php 401 V class-phpass.php 6771 V class-phpmailer.php 664 V class-pop3.php 171 V class-requests.php 2237 V class-simplepie.php 453 V class-smtp.php 457 V class-snoopy.php 37715 V class-spl.php 171 V class-walker-category-dropdown.php 2469 V class-walker-category.php 8477 V class-walker-comment.php 14221 V class-walker-nav-menu.php 12044 V class-walker-page-dropdown.php 2710 V class-walker-page.php 7612 V class-wp-admin-bar.php 18002 V class-wp-ajax-response.php 5288 V class-wp-application-passwords.php 17099 V class-wp-block-bindings-registry.php 8263 V class-wp-block-bindings-source.php 2992 V class-wp-block-editor-context.php 1350 V class-wp-block-list.php 4713 V class-wp-block-metadata-registry.php 11846 V class-wp-block-parser-block.php 2555 V class-wp-block-parser-frame.php 1994 V class-wp-block-parser.php 11525 V class-wp-block-pattern-categories-registry.php 4383 V class-wp-block-patterns-registry.php 10265 V class-wp-block-processor.php 69914 V class-wp-block-styles-registry.php 6419 V class-wp-block-supports.php 7578 V class-wp-block-template.php 2111 V class-wp-block-templates-registry.php 7080 V class-wp-block-type-registry.php 5305 V class-wp-block-type.php 17222 V class-wp-block.php 28236 V class-wp-classic-to-block-menu-converter.php 4026 V class-wp-comment-query.php 49040 V class-wp-comment.php 17249 V class-wp-connector-registry.php 15181 V class-wp-customize-control.php 26112 V class-wp-customize-manager.php 202908 V class-wp-customize-nav-menus.php 58034 V class-wp-customize-panel.php 10703 V class-wp-customize-section.php 11209 V class-wp-customize-setting.php 29956 V class-wp-customize-widgets.php 72596 V class-wp-date-query.php 35970 V class-wp-dependencies.php 17089 V class-wp-dependency.php 2653 V class-wp-duotone.php 40836 V class-wp-editor.php 72228 V class-wp-embed.php 15908 V class-wp-error.php 7514 V class-wp-exception.php 253 V class-wp-fatal-error-handler.php 8150 V class-wp-feed-cache-transient.php 3304 V class-wp-feed-cache.php 969 V class-wp-filter-sentinel.php 760 V class-wp-hook.php 17584 V class-wp-http-cookie.php 7269 V class-wp-http-curl.php 13261 V class-wp-http-encoding.php 6689 V class-wp-http-ixr-client.php 3516 V class-wp-http-proxy.php 5980 V class-wp-http-requests-hooks.php 2022 V class-wp-http-requests-response.php 4243 V class-wp-http-response.php 2977 V class-wp-http-streams.php 16764 V class-wp-http.php 41641 V class-wp-icon-collections-registry.php 5805 V class-wp-icons-registry.php 9903 V class-wp-image-editor-gd.php 20741 V class-wp-image-editor-imagick.php 43454 V class-wp-image-editor.php 17456 V class-wp-list-util.php 7443 V class-wp-locale-switcher.php 6776 V class-wp-locale.php 16848 V class-wp-matchesmapregex.php 1828 V class-wp-meta-query.php 30507 V class-wp-metadata-lazyloader.php 6833 V class-wp-navigation-fallback.php 9193 V class-wp-network-query.php 19989 V class-wp-network.php 12411 V class-wp-object-cache.php 17524 V class-wp-oembed-controller.php 6905 V class-wp-oembed.php 34372 V class-wp-paused-extensions-storage.php 5067 V class-wp-phpmailer.php 4348 V class-wp-plugin-dependencies.php 25209 V class-wp-post-type-variable.php 0 V class-wp-post-type.php 30672 V class-wp-post.php 8806 V class-wp-query.php 164148 V class-wp-recovery-mode-cookie-service.php 6877 V class-wp-recovery-mode-email-service.php 11162 V class-wp-recovery-mode-key-service.php 4914 V class-wp-recovery-mode-link-service.php 3523 V class-wp-recovery-mode.php 11460 V class-wp-rewrite.php 63693 V class-wp-role.php 2523 V class-wp-roles.php 9326 V class-wp-script-modules.php 40743 V class-wp-scripts.php 36754 V class-wp-session-tokens.php 7319 V class-wp-simplepie-file.php 3552 V class-wp-simplepie-sanitize-kses.php 1903 V class-wp-site-query.php 31482 V class-wp-site.php 7836 V class-wp-speculation-rules.php 7884 V class-wp-styles.php 13316 V class-wp-tax-query.php 19577 V class-wp-taxonomy.php 18559 V class-wp-term-query.php 40751 V class-wp-term.php 5263 V class-wp-text-diff-renderer-inline.php 979 V class-wp-text-diff-renderer-table.php 18925 V class-wp-textdomain-registry.php 10481 V class-wp-theme-json-data.php 1805 V class-wp-theme-json-resolver.php 35692 V class-wp-theme-json-schema.php 7367 V class-wp-theme-json.php 222059 V class-wp-theme.php 65811 V class-wp-token-map.php 29032 V class-wp-url-pattern-prefixer.php 4802 V class-wp-user-meta-session-tokens.php 2954 V class-wp-user-query.php 44102 V class-wp-user-request.php 2342 V class-wp-user.php 23189 V class-wp-view-config-data.php 29427 V class-wp-walker.php 13292 V class-wp-widget-factory.php 4113 V class-wp-widget.php 18452 V class-wp-xmlrpc-server.php 217288 V class-wp.php 26520 V class-wpdb.php 121437 V class.wp-dependencies.php 373 V class.wp-scripts.php 343 V class.wp-styles.php 338 V comment-template.php 103211 V comment.php 150630 V compat-utf8.php 19386 V compat.php 22479 V connectors.php 32922 V cron.php 46266 V css - customize - date.php 400 V default-constants.php 11365 V default-filters.php 39500 V default-widgets.php 2288 V deprecated.php 193977 V embed-template.php 338 V embed.php 39215 V error-protection.php 4092 V feed-atom-comments.php 5504 V feed-atom.php 3114 V feed-rdf.php 2668 V feed-rss-core.php 146 V feed-rss.php 1189 V feed-rss2-comments.php 4136 V feed-rss2.php 3799 V feed.php 25189 V fonts - fonts.php 9789 V formatting.php 357678 V functions.php 295481 V functions.wp-scripts.php 20492 V functions.wp-styles.php 8654 V general-template-get.php 146 V general-template.php 184198 V global-styles-and-settings.php 20780 V html-api - http.php 28961 V https-detection.php 5857 V https-migration.php 4741 V icons.php 6334 V images - interactivity-api - js - json-schema.php 7802 V kses.php 88497 V l10n - l10n.php 71415 V link-template.php 160143 V load.php 56475 V locale.php 162 V media-template.php 65759 V media.php 236804 V meta.php 66739 V ms-blogs.php 26324 V ms-default-constants.php 4921 V ms-default-filters.php 6636 V ms-deprecated.php 21787 V ms-files.php 2857 V ms-functions.php 92530 V ms-load.php 20055 V ms-network.php 3782 V ms-settings.php 4197 V ms-site.php 41729 V nav-menu-template.php 25983 V nav-menu.php 44269 V option.php 105246 V php-ai-client - php-compat - pluggable-deprecated.php 6324 V pluggable.php 127919 V plugin.php 37123 V pomo - post-formats.php 7070 V post-template.php 69129 V post-thumbnail-template.php 10879 V post.php 305215 V query.php 37554 V registration-functions.php 200 V registration.php 200 V rest-api - rest-api.php 102951 V revision.php 31241 V rewrite.php 19567 V robots-template.php 5185 V rss-functions.php 277 V rss.php 23203 V script-loader.php 163550 V script-modules.php 12311 V session.php 258 V shortcodes-set.php 0 V shortcodes.php 24034 V sitemaps - sitemaps.php 3238 V sodium_compat - speculative-loading.php 11880 V spl-autoload-compat.php 441 V style-engine - style-engine.php 8045 V taxonomy.php 178307 V template-canvas.php 544 V template-loader.php 4267 V template.php 38826 V theme-compat - theme-i18n.json 1892 V theme-previews.php 2887 V theme-templates.php 4060 V theme.json 9480 V theme.php 134913 V update.php 38269 V user.php 180301 V utf8.php 6977 V vars.php 6600 V version.php 1103 V view-config.php 19087 V view-transitions.php 602 V widgets - widgets.php 70866 V wp-db.php 445 V wp-diff.php 792 V
MyMelon - Digital Marketing and Creative Agency in Delhi, India