Initial setup, untested
Validate Build / validate-build (push) Failing after 36s

This commit is contained in:
Cooper Dalrymple
2026-08-25 14:58:39 -05:00
parent 7159f7099e
commit 5f702470cc
17 changed files with 2573 additions and 163 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
/**
* @package ogre-consent
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 0.0.0
* @since 0.0.0
*/
namespace Ogre\Consent\Services;
use Ogre\Consent\BlockService;
use WP_Block;
use Override;
use WP_HTML_Tag_Processor;
defined('ABSPATH') || exit;
final class YouTube extends BlockService {
protected function __construct() {
parent::__construct('core/iframe', 'youtube');
}
#[Override]
public function render_block(string $block_content, array $block, WP_Block $instance): string
{
// TODO: Check block iframe type
$tags = new WP_HTML_Tag_Processor($block_content);
if ($tags->next_tag('iframe')) {
$tags->set_attribute('data-name', $this->name);
$src = $tags->get_attribute('src');
$tags->remove_attribute('src');
$tags->set_attribute('data-src', $src);
}
return $tags->get_updated_html();
}
}
YouTube::instance();