Files
Landing/wp-content/themes/upstudy/learnpress/tpl-part/single/meta-custom.php
T

26 lines
1.3 KiB
PHP
Raw Normal View History

2026-04-23 04:33:43 +03:30
<?php
$lp_custom_feature_group = get_post_meta(get_the_ID(), 'lp_custom_feature_group', true);
if ($lp_custom_feature_group) {
foreach ((array) $lp_custom_feature_group as $key => $entry) {
$icon = !empty($entry['lp_custom_feature_group_icon']) ? $entry['lp_custom_feature_group_icon'] : 'dt-icon-play-button';
$label = !empty($entry['lp_custom_feature_group_label']) ? $entry['lp_custom_feature_group_label'] : '';
$value = !empty($entry['lp_custom_feature_group_value']) ? $entry['lp_custom_feature_group_value'] : '';
$unit = !empty($entry['lp_custom_feature_group_unit']) ? $entry['lp_custom_feature_group_unit'] : '';
// Detect icon type
$if_has_dashicons = (strpos($icon, 'dashicons') !== false) ? 'dashicons' : '';
$if_has_fontawesome = (strpos($icon, 'fa-') !== false) ? 'fa' : '';
echo '<li>';
echo '<span class="label"><i class="meta-icon ' . esc_attr($if_has_fontawesome . ' ' . $if_has_dashicons . ' ' . $icon) . '"></i> ' . esc_html($label) . '</span>';
echo '<span class="value">';
echo '<span class="tutor-meta-level">' . esc_html($value) . '</span>';
if ($unit) {
echo '<span class="tutor-meta-value tutor-color-secondary tutor-mr-4">' . esc_html($unit) . '</span>';
}
echo '</span>';
echo '</li>';
}
}