apply_filters( 'should_load_remote_block_patterns', bool $should_load_remote )

Filter to disable remote block patterns.


$should_load_remote bool

Top ↑


File: wp-includes/block-patterns.php. View all references

$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );

Top ↑


Version Description
5.8.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Ian Sackofwits

    If you want to limit access to the remote block patterns to only admins, you can do so by verifying the capabilities of the user:

    add_filter( 'should_load_remote_block_patterns', 'limit_access_load_remote_block_patterns' );
    function limit_access_load_remote_block_patterns() 
    	return current_user_can( 'activate_plugins' );

You must log in before being able to contribute a note or feedback.