Title: _load_remote_featured_patterns
Published: February 3, 2022
Last modified: August 20, 2026

---

# _load_remote_featured_patterns()

## In this article

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

Register `Featured` (category) patterns from wordpress.org/patterns.

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

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

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

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/_load_remote_featured_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_featured_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.

  | 
| [WP_Block_Patterns_Registry::get_instance()](https://developer.wordpress.org/reference/classes/wp_block_patterns_registry/get_instance/)`wp-includes/class-wp-block-patterns-registry.php` |

Utility method to retrieve the main instance of the class.

  | 
| [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.

  | 
| [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_featured_patterns/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/_load_remote_featured_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_featured_patterns/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.3.0](https://developer.wordpress.org/reference/since/6.3.0/) | Add `'pattern-directory/featured'` to the pattern’s `'source'`. | 
| [6.2.0](https://developer.wordpress.org/reference/since/6.2.0/) | Normalized 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/) | Introduced. |

## User Contributed Notes

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