refactor: drop the featured-project picker in favour of the project list
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
12 files changed
+6
-362
No files matched your search
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "chrnx/selected-work",
|
||||
"version": "0.4.4",
|
||||
"title": "Selected Work",
|
||||
"category": "theme",
|
||||
"description": "Hand-picked projects first, then the most recent ones.",
|
||||
"textdomain": "chrnx",
|
||||
"attributes": {
|
||||
"limit": { "type": "integer", "default": 3, "minimum": 1, "maximum": 12 },
|
||||
"headingLevel": { "type": "integer", "default": 3, "enum": [2, 3, 4, 5, 6] }
|
||||
},
|
||||
"supports": { "html": false },
|
||||
"render": "file:./render.php"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Selected Work block render.
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
|
||||
$chrnx_limit = isset( $attributes['limit'] ) ? min( 12, max( 1, absint( $attributes['limit'] ) ) ) : 3;
|
||||
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 3, 3 );
|
||||
$chrnx_ids = chrnx_get_selected_project_ids( $chrnx_limit );
|
||||
?>
|
||||
<div <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-selected-work' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php if ( empty( $chrnx_ids ) ) : ?>
|
||||
<p class="chrnx-selected-work__empty"><?php echo esc_html__( 'No projects published yet.', 'chrnx' ); ?></p>
|
||||
<?php else : ?>
|
||||
<ul class="chrnx-selected-work__list">
|
||||
<?php foreach ( $chrnx_ids as $chrnx_project_id ) : ?>
|
||||
<li class="chrnx-selected-work__item">
|
||||
<h<?php echo esc_attr( $chrnx_heading ); ?> class="chrnx-selected-work__title">
|
||||
<a href="<?php echo esc_url( get_permalink( $chrnx_project_id ) ); ?>"><?php echo esc_html( get_the_title( $chrnx_project_id ) ); ?></a>
|
||||
</h<?php echo esc_attr( $chrnx_heading ); ?>>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
Reference in new issue
Block a user