changes to blocks and styles
This commit is contained in:
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user