HEX
Server: nginx/1.18.0
System: Linux mail.dakarash.co.id 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: /home/dakarash.co.id/public_html/plugins/presto-player/inc/Blocks/ReusableVideoBlock.php
<?php

namespace PrestoPlayer\Blocks;

use PrestoPlayer\Models\ReusableVideo;

class ReusableVideoBlock
{
    /**
     * Block name
     *
     * @var string
     */
    protected $name = 'reusable-display';

    /**
     * Register Block
     *
     * @return void
     */
    public function register()
    {
        register_block_type(
            "presto-player/$this->name",
            [
                'render_callback' => [$this, 'html'],
            ]
        );
    }

    /**
     * Dynamic block output
     *
     * @param array $attributes
     * @param string $content
     * @return void
     */
    public function html($attributes)
    {
        $block = new ReusableVideo($attributes['id']);
        return $block->renderBlock();
    }
}