piotrpress/dynamic-block

This WordPress plugin adds a dynamic block which renders an output of a selected php callback function added via a filter hook.

v0.2.0 2024-01-26 16:50 UTC

This package is auto-updated.

Last update: 2024-10-30 13:51:35 UTC


README

This WordPress plugin adds a dynamic block which renders an output of a selected php callback function added via a filter hook.

Usage

Add piotrpress/dynamic_block/callbacks filter.

Example

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

Requirements

PHP >= 7.4 version.

License

GPL v3 or later