'AdFuz Ad Space', 'description' => 'Display an AdFuz Ad Space anywhere on your site.', 'category' => 'widgets', 'icon' => 'money-alt', 'keywords' => array( 'ad', 'adspace', 'ad-fuz', 'advertisement', 'banner' ), 'supports' => array( 'html' => false, 'align' => array( 'wide', 'full' ), ), 'attributes' => array( 'adspace_id' => array( 'type' => 'integer', 'default' => 0, ), ), 'render_callback' => array( static::class, 'render' ), 'editor_script' => 'adfuz-block-editor', 'editor_style' => 'adfuz-block-editor-style', 'style' => 'adfuz-block-style', ) ); } public static function render( array $attributes ): string { $id = (int) ( $attributes['adspace_id'] ?? 0 ); if ( ! $id ) { return '
Select an Ad Space in the block settings.
'; } return do_shortcode( "[ad-fuz ad_space_id=\"{$id}\"]" ); } }