feat(projects): add single-projects detail template
This commit is contained in:
@@ -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 ); ?>
|
||||
|
||||
Reference in New Issue
Block a user