[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

Blocks API: WP_Block_Patterns_Registry class

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

Defines 11 functions

  register()
  unregister()
  prepare_content()
  get_content()
  get_registered()
  get_all_registered()
  is_registered()
  __wakeup()
  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.

return: bool True if the pattern was registered with success and false otherwise.
param: string $pattern_name       Block pattern name including namespace.
param: array  $pattern_properties {

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

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

prepare_content( $pattern, $hooked_blocks )   X-Ref
Prepares the content of a block pattern. If hooked blocks are registered, they get injected into the pattern,
when they met the defined criteria.

return: string The content of the block pattern.
param: array $pattern       Registered pattern properties.
param: array $hooked_blocks The list of hooked blocks.

get_content( $pattern_name, $outside_init_only = false )   X-Ref
Retrieves the content of a registered block pattern.

return: string The content of the block pattern.
param: string $pattern_name      Block pattern name including namespace.
param: bool   $outside_init_only Optional. Return only patterns registered outside the `init` action. Default false.

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

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

get_all_registered( $outside_init_only = false )   X-Ref
Retrieves all registered block patterns.

return: array[] Array of arrays containing the registered block patterns properties,
param: bool $outside_init_only Return only patterns registered outside the `init` action.

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

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

__wakeup()   X-Ref
No description

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.

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

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

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

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



Generated : Wed Apr 24 08:20:01 2024 Cross-referenced by PHPXref