Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrpress/wordpress-dynamic-block
This WordPress plugin adds a dynamic block which renders an output of a selected php callback function added via a filter hook.
https://github.com/piotrpress/wordpress-dynamic-block
Last synced: 5 days ago
JSON representation
This WordPress plugin adds a dynamic block which renders an output of a selected php callback function added via a filter hook.
- Host: GitHub
- URL: https://github.com/piotrpress/wordpress-dynamic-block
- Owner: PiotrPress
- License: gpl-3.0
- Created: 2023-05-30T14:17:34.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-26T16:51:08.000Z (10 months ago)
- Last Synced: 2024-08-09T13:43:52.101Z (3 months ago)
- Language: PHP
- Size: 190 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# WordPress Dynamic Block
This WordPress plugin adds a [dynamic block](https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/creating-dynamic-blocks/) which renders an output of a selected php callback function added via a [filter hook](https://developer.wordpress.org/plugins/hooks/filters/).
## Usage
Add `piotrpress/dynamic_block/callbacks` filter.
## Example
```php
add_filter( 'piotrpress/dynamic_block/callbacks', function( $callbacks ) {
$callbacks[ 'Current date' ] = fn() => date( 'Y-m-d H:i:s' );
return $callbacks;
} );
```## Screenshot
![Dynamic block in WordPress block editor view](screenshot-1.png)
## Requirements
PHP >= `7.4` version.
## License
[GPL v3 or later](license.txt)