feat: add editorial query blocks

This commit is contained in:
chrnx committed 2026-08-11 15:27:44 -05:00
1 parent 835fb74ebf
commit 89dcc53e02
24 files changed
+1421

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/subscribe-cta",
"version": "0.1.0",
"title": "Subscribe CTA",
"category": "theme",
"description": "A call to action linked to the configured subscribe page.",
"textdomain": "chrnx",
"attributes": {
"headingLevel": { "type": "integer", "default": 2, "enum": [2, 3, 4, 5, 6] }
},
"supports": { "html": false, "align": ["wide", "full"] },
"render": "file:./render.php"
}
+18
View File
@@ -0,0 +1,18 @@
<?php
/**
* Subscribe CTA block render.
*
* @package CHRNX
*/
$chrnx_url = chrnx_get_subscribe_url();
if ( '' === $chrnx_url ) {
return;
}
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 2, 2 );
?>
<section <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-subscribe-cta' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<h<?php echo esc_attr( $chrnx_heading ); ?> class="chrnx-subscribe-cta__title"><?php echo esc_html__( 'Stay in the loop', 'chrnx' ); ?></h<?php echo esc_attr( $chrnx_heading ); ?>>
<p><?php echo esc_html__( 'Get new stories and episodes when they are published.', 'chrnx' ); ?></p>
<a class="chrnx-subscribe-cta__link" href="<?php echo esc_url( $chrnx_url ); ?>"><?php echo esc_html__( 'Subscribe', 'chrnx' ); ?></a>
</section>