[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Templates registry functions.
File Size: | 256 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
register( $template_name, $args = array() X-Ref |
Registers a template. return: WP_Block_Template|WP_Error The registered template on success, or WP_Error on failure. param: string $template_name Template name including namespace. param: array $args Optional. Array of template arguments. |
get_all_registered() X-Ref |
Retrieves all registered templates. return: WP_Block_Template[] Associative array of `$template_name => $template` pairs. |
get_registered( $template_name ) X-Ref |
Retrieves a registered template by its name. return: WP_Block_Template|null The registered template, or null if it is not registered. param: string $template_name Template name including namespace. |
get_by_slug( $template_slug ) X-Ref |
Retrieves a registered template by its slug. return: WP_Block_Template|null The registered template, or null if it is not registered. param: string $template_slug Slug of the template. |
get_by_query( $query = array() X-Ref |
Retrieves registered templates matching a query. return: WP_Block_Template[] Associative array of `$template_name => $template` pairs. param: array $query { |
is_registered( $template_name ) X-Ref |
Checks if a template is registered. return: bool True if the template is registered, false otherwise. param: string $template_name Template name. |
unregister( $template_name ) X-Ref |
Unregisters a template. return: WP_Block_Template|WP_Error The unregistered template on success, or WP_Error on failure. param: string $template_name Template name including namespace. |
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_Templates_Registry The main instance. |
Generated : Sat Dec 21 08:20:01 2024 | Cross-referenced by PHPXref |