tp TouchPointWP Blocks BlocksController - TenthPres/TouchPoint-WP GitHub Wiki
tp\TouchPointWP\Blocks\BlocksController
- Full name:
\tp\TouchPointWP\Blocks\BlocksController - This class implements:
\tp\TouchPointWP\Interfaces\api - This class is an Abstract class
Methods
init
Registers the block using a blocks-manifest.php file, which improves the performance of block type registration.
public static init(): void
Behind the scenes, it also registers all assets so they can be enqueued through the block editor in the corresponding context.
-
This method is static. See Also:
-
https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
enqueueBlockAssets
public static enqueueBlockAssets(): void
- This method is static.
api
Handle API requests
public static api(array $uri): bool
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$uri |
array | The request URI already parsed by parse_url() |
Return Value:
False if endpoint is not found. Should print the result.