feat(projects): add single-projects detail template

This commit is contained in:
Keith Solomon
2026-08-16 12:54:38 -05:00
parent 5ab42f02ab
commit 353030d2dc
6 changed files with 282 additions and 15 deletions
+12 -6
View File
@@ -3,23 +3,29 @@
* Project Meta Row Component
*
* Renders one row of the Repository Details table on the project detail
* page. Expects $label, $value, and $icon (optional decorative SVG) in
* scope.
* page. Reads $label, $value, and optional $icon from get_query_var(),
* because get_template_part() does not forward its $args parameter into
* the partial's local scope.
*
* @package KsPortfolio
*/
namespace KsPortfolio;
if ( ! isset( $label ) || ! isset( $value ) ) {
$row_label = get_query_var( 'label' );
$row_value = get_query_var( 'value' );
$icon = get_query_var( 'icon' );
if ( ! isset( $row_label ) || ! isset( $row_value ) ) {
return;
}
$row_label = (string) $label;
$row_value = (string) $value;
$row_label = (string) $row_label;
$row_value = (string) $row_value;
?>
<div class="meta-row">
<span class="meta-row__label">
<?php if ( isset( $icon ) && $icon ) : ?>
<?php if ( ! empty( $icon ) ) : ?>
<span class="meta-row__icon" aria-hidden="true"><?php echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- icon is hardcoded decorative SVG in callers. ?></span>
<?php endif; ?>
<?php echo esc_html( $row_label ); ?>