changes to blocks and styles

This commit is contained in:
Jeremy Rangel
2024-12-27 22:56:39 -08:00
parent 93cc7be3bf
commit 462cffdddc
39 changed files with 959 additions and 228 deletions

View File

@ -426,6 +426,12 @@ function build_gallery_styles($attributes, $unique_class) {
// Render the block
function render_lcp_gallery_block($attributes) {
$media_ids = get_media_ids($attributes);
// Check if any Media IDs are present
// If not, return null
// Later, more logic will be needed to verify if there are any gallery items from other sources
if ($media_ids) {
// Generate a unique class for each gallery
$unique_class = lcp_random_string(12, true);
// Get the media IDs based on the attributes
@ -478,7 +484,10 @@ function render_lcp_gallery_block($attributes) {
return "
<div class= '{$classes}' data-lgSettings='" . esc_attr($gallery_settings_json) . "'>
{$gallery_items_html}
</div>";
</div>"; }
else {
return null;
}
}
/* Initialize Gallery Block */
function lcp_gallery_block_init() {