Title: _load_remote_block_patterns
Published: July 20, 2021
Last modified: August 20, 2026

---

# _load_remote_block_patterns( WP_Screen $deprecated = `null` )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#changelog)

Register Core’s official patterns from wordpress.org/patterns.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#parameters)󠁿

 `$deprecated`[WP_Screen](https://developer.wordpress.org/reference/classes/wp_screen/)
optional

Unused. Formerly the screen that the current request was triggered from.

Default:`null`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#source)󠁿

    ```php
    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 );
    		}
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/file/wp-includes/block-patterns.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/block-patterns.php#L281)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/block-patterns.php#L281-L318)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#hooks)󠁿

 [apply_filters( ‘should_load_remote_block_patterns’, bool $should_load_remote )](https://developer.wordpress.org/reference/hooks/should_load_remote_block_patterns/)

Filter to disable remote block patterns.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_normalize_remote_block_pattern()](https://developer.wordpress.org/reference/functions/wp_normalize_remote_block_pattern/)`wp-includes/block-patterns.php` |

Normalize the pattern properties to camelCase.

  | 
| [register_block_pattern()](https://developer.wordpress.org/reference/functions/register_block_pattern/)`wp-includes/block-patterns.php` |

Registers a new block pattern.

  | 
| [rest_do_request()](https://developer.wordpress.org/reference/functions/rest_do_request/)`wp-includes/rest-api.php` |

Do a REST request.

  | 
| [WP_REST_Request::__construct()](https://developer.wordpress.org/reference/classes/wp_rest_request/__construct/)`wp-includes/rest-api/class-wp-rest-request.php` |

Constructor.

  | 
| [get_theme_support()](https://developer.wordpress.org/reference/functions/get_theme_support/)`wp-includes/theme.php` |

Gets the theme support arguments passed when registering that support.

  | 
| [sanitize_title()](https://developer.wordpress.org/reference/functions/sanitize_title/)`wp-includes/formatting.php` |

Sanitizes a string into a slug, which can be used in URLs or HTML attributes.

  | 
| [_deprecated_argument()](https://developer.wordpress.org/reference/functions/_deprecated_argument/)`wp-includes/functions.php` |

Marks a function argument as deprecated and inform when it has been used.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 3 more](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#)

| Used by | Description | 
| [WP_REST_Block_Patterns_Controller::get_items()](https://developer.wordpress.org/reference/classes/wp_rest_block_patterns_controller/get_items/)`wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php` |

Retrieves all block patterns.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_load_remote_block_patterns/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.3.0](https://developer.wordpress.org/reference/since/6.3.0/) | Add `'pattern-directory/core'` to the pattern’s `'source'`. | 
| [6.2.0](https://developer.wordpress.org/reference/since/6.2.0/) | Normalize the pattern from the API (snake_case) to the format expected by `register_block_pattern` (camelCase). | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | The $current_screen argument was removed. | 
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fsiteproxy.myworkereeez.workers.dev/%3A443%2Fhttps%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_load_remote_block_patterns%2F)
before being able to contribute a note or feedback.