[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-block-patterns-registry.php (summary)

Blocks API: WP_Block_Patterns_Registry class

File Size: 209 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  register()
  unregister()
  get_registered()
  get_all_registered()
  is_registered()
  get_instance()
  register_block_pattern()
  unregister_block_pattern()

Functions
Functions that are not part of a class:

register( $pattern_name, $pattern_properties )   X-Ref
Registers a block pattern.

param: string $pattern_name       Block pattern name including namespace.
param: array  $pattern_properties {
return: bool True if the pattern was registered with success and false otherwise.
since: 5.5.0
since: 5.8.0 Added support for the `blockTypes` property.

unregister( $pattern_name )   X-Ref
Unregisters a block pattern.

param: string $pattern_name Block pattern name including namespace.
return: bool True if the pattern was unregistered with success and false otherwise.
since: 5.5.0

get_registered( $pattern_name )   X-Ref
Retrieves an array containing the properties of a registered block pattern.

param: string $pattern_name Block pattern name including namespace.
return: array Registered pattern properties.
since: 5.5.0

get_all_registered()   X-Ref
Retrieves all registered block patterns.

return: array[] Array of arrays containing the registered block patterns properties,
since: 5.5.0

is_registered( $pattern_name )   X-Ref
Checks if a block pattern is registered.

param: string $pattern_name Block pattern name including namespace.
return: bool True if the pattern is registered, false otherwise.
since: 5.5.0

get_instance()   X-Ref
Utility method to retrieve the main instance of the class.

The instance will be created if it does not exist yet.

return: WP_Block_Patterns_Registry The main instance.
since: 5.5.0

register_block_pattern( $pattern_name, $pattern_properties )   X-Ref
Registers a new block pattern.

param: string $pattern_name       Block pattern name including namespace.
param: array  $pattern_properties List of properties for the block pattern.
return: bool True if the pattern was registered with success and false otherwise.
since: 5.5.0

unregister_block_pattern( $pattern_name )   X-Ref
Unregisters a block pattern.

param: string $pattern_name Block pattern name including namespace.
return: bool True if the pattern was unregistered with success and false otherwise.
since: 5.5.0



Generated: Sat Apr 20 01:00:03 2024 Cross-referenced by PHPXref 0.7.1