'product-categories',
'hide_empty' => false,
'orderby' => 'name'
));
$options = [];
if (!is_wp_error($categories) && !empty($categories)) {
foreach ($categories as $category) {
$options[$category->term_id] = $category->name;
}
}
return $options;
}
public static function renderCollectionCard($settings, $post, $post_index = 1, $uid = '')
{
$content = Frontend::get_content_wrapper($settings, Arr::get($settings, 'fields', []), $post);
if ($post_index === 1) {
echo "
";
} else {
echo "
';
}
public static function isTemplate()
{
$is_template = false;
if (isset($_GET['bricks']) && $_GET['bricks'] === 'run') {
$request_uri = $_SERVER['REQUEST_URI'] ?? '';
$is_template = strpos($request_uri, '/template/') !== false;
}
return $is_template;
}
public static function getAllowedHtmlForContent()
{
$allowed_html = wp_kses_allowed_html('post');
$allowed_html['iframe'] = [
'src' => true,
'width' => true,
'height' => true,
'frameborder' => true,
'allow' => true,
'allowfullscreen' => true,
'title' => true,
'referrerpolicy' => true,
];
return $allowed_html;
}
}