feat(projects): add project meta-row component
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @package KsPortfolio
|
||||
*/
|
||||
|
||||
namespace KsPortfolio;
|
||||
|
||||
if ( ! isset( $label ) || ! isset( $value ) ) {
|
||||
return;
|
||||
}
|
||||
$row_label = (string) $label;
|
||||
$row_value = (string) $value;
|
||||
?>
|
||||
<div class="meta-row">
|
||||
<span class="meta-row__label">
|
||||
<?php if ( isset( $icon ) && $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 ); ?>
|
||||
</span>
|
||||
<span class="meta-row__value"><?php echo esc_html( $row_value ); ?></span>
|
||||
</div>
|
||||
Reference in New Issue
Block a user