$block ) { if ( !empty( $block['attrs']['block_id'] ) && $block['attrs']['block_id'] == $attributes['block_id'] ) { $block_order = $post_order; } if ( !empty( $block['blockName'] ) ) { $post_order++; } } } else { $block_order = $lightspeed_block_order; } if ( !isset( $attributes['background_display'] ) || !$attributes['background_display'] ) { $attributes['background_display'] = true; $attributes['background_color'] = array(); $attributes['background_utility'] = ''; } if ( get_option( 'areoi-lightspeed-styles-strip-background', false ) ) { if ( $attributes['background_utility'] == '' && empty( $attributes['background_color']['rgb'] ) ) { if ( $block_order % 3 == 0 && $block_order > 0 ) { $attributes['background_utility'] = 'bg-light'; } elseif ( $block_order % 4 == 0 ) { $attributes['background_utility'] = 'bg-dark'; } else { $attributes['background_utility'] = 'bg-body'; } if ( in_array( $block_type, array( 'hero' ) ) ) { $attributes['background_utility'] = 'bg-primary'; } if ( in_array( $block_type, array( 'call-to-action' ) ) ) { $attributes['background_utility'] = 'bg-secondary'; } } } else { if ( $attributes['background_utility'] == '' && empty( $attributes['background_color']['rgb'] ) ) { $attributes['background_utility'] = 'bg-body'; } } $pattern_align = !empty( $attributes['alignment'] ) ? $attributes['alignment'] : 'start'; if ( get_option( 'areoi-lightspeed-styles-strip-alignment', false ) ) { if ( empty( $attributes['alignment'] ) ) { if ( $block_order % 2 == 0 ) { $pattern_align = 'end'; } else { $pattern_align = 'start'; } } if ( empty( $attributes['alignment'] ) && in_array( $block_type, array( 'content-with-media' ) ) ) { if ( $block_order % 2 == 0 ) { $attributes['alignment'] = 'end'; } else { $attributes['alignment'] = 'start'; } } } if ( !in_array( $block_type, array( 'header' ) ) ) { $lightspeed_block_order++; } global $lightspeed_attributes; $lightspeed_attributes = $attributes; $allow_pattern = true; $divider_styles = lightspeed_get_divider_styles( $block_order ); $template = lightspeed_get_template( $block_type, $block_order ); switch ( $block_type ) { case 'header': $padding = 20; switch ( lightspeed_get_attribute( 'padding', null ) ) { case 'xs': $padding = 10; break; case 'sm': $padding = 15; break; case 'lg': $padding = 25; break; case 'none': $padding = 0; break; } $content = '
"The Blink Test" refers to the commonly accepted 3-5 seconds during which a visitor lands on your website, judges it, and decides if they want to stay there and do something or abandon ship.
' ); $meta['attributes']['active_column'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['columns'] = array( 'type' => 'array', 'default' => array() ); $meta['attributes']['include_cta'] = array( 'type' => 'boolean', 'default' => true ); $meta['attributes']['cta'] = array( 'type' => 'string', 'default' => 'Call to Action' ); $meta['attributes']['cta_size'] = array( 'type' => 'string', 'default' => 'btn-lg' ); $meta['attributes']['url'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['opensInNewTab'] = array( 'type' => 'boolean', 'default' => false ); $meta['attributes']['heading_color'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['sub_heading_color'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['introduction_color'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['cta_color'] = array( 'type' => 'string', 'default' => '' ); } if ( !empty( $meta['supports']['lightspeed_posts'] ) ) { $meta['attributes']['post_background_color'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['post_title_color'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['post_excerpt_color'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['is_post_query'] = array( 'type' => 'boolean', 'default' => false ); $meta['attributes']['post_type'] = array( 'type' => 'string', 'default' => 'post' ); $meta['attributes']['display_posts'] = array( 'type' => 'string', 'default' => 'selected' ); $meta['attributes']['posts_per_page'] = array( 'type' => 'string', 'default' => '8' ); $meta['attributes']['orderby'] = array( 'type' => 'string', 'default' => 'title' ); $meta['attributes']['order'] = array( 'type' => 'string', 'default' => 'asc' ); $meta['attributes']['post_ids'] = array( 'type' => 'array', 'default' => [] ); $meta['attributes']['include_pagination'] = array( 'type' => 'boolean', 'default' => false ); $meta['attributes']['pagination_color'] = array( 'type' => 'string', 'default' => 'btn-primary' ); $meta['attributes']['include_media'] = array( 'type' => 'boolean', 'default' => true ); $meta['attributes']['include_title'] = array( 'type' => 'boolean', 'default' => true ); $meta['attributes']['include_excerpt'] = array( 'type' => 'boolean', 'default' => true ); $meta['attributes']['include_permalink'] = array( 'type' => 'boolean', 'default' => true ); } if ( !empty( $meta['supports']['lightspeed_media'] ) ) { $meta['attributes']['media_shape'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['media_fit'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['is_post_image'] = array( 'type' => 'boolean', 'default' => false ); $meta['attributes']['image'] = array( 'type' => 'object', 'default' => lightspeed_get_placeholder_images( 2 ) ); $meta['attributes']['video'] = array( 'type' => 'object', 'default' => lightspeed_get_placeholder_videos( 1 ) ); } if ( !empty( $meta['supports']['lightspeed_gallery'] ) ) { $meta['attributes']['gallery'] = array( 'type' => 'array', 'default' => $medias ); } if ( !empty( $meta['supports']['lightspeed_items'] ) ) { $meta['attributes']['active_item'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['items'] = array( 'type' => 'array', 'default' => $items ); } if ( !empty( $meta['supports']['lightspeed_background'] ) ) { $meta['attributes']['background_display'] = array( 'type' => 'boolean', 'default' => false ); $meta['attributes']['background_utility'] = array( 'type' => 'string', 'default' => '' ); $meta['attributes']['background_color'] = array( 'type' => 'object', 'default' => [] ); $meta['attributes']['background_image'] = array( 'type' => 'object', 'default' => [] ); $meta['attributes']['background_video'] = array( 'type' => 'object', 'default' => [] ); $meta['attributes']['background_display_overlay'] = array( 'type' => 'boolean', 'default' => false ); $meta['attributes']['background_overlay'] = array( 'type' => 'object', 'default' => array( 'rgb' => array( 'r' => 0, 'g' => 0, 'b' => 0, 'a' => 1 ) ) ); } $meta['render_callback'] = function( $attributes, $content ) use ( $block_key ) { return lightspeed_render_block( $block_key, $attributes, $content ); }; return $meta; } function lightspeed_get_placeholder_introduction() { return 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ac molestie tellus, id fringilla velit. Donec ultrices consequat augue auctor aliquam. Morbi venenatis semper diam, ut facilisis tellus.
'; } function lightspeed_get_placeholder_items_with_images() { $items = array( array( 'id' => 1, 'heading' => 'Item 1', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => lightspeed_get_placeholder_images( 0 ) ), array( 'id' => 2, 'heading' => 'Item 2', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => lightspeed_get_placeholder_images( 1 ) ), array( 'id' => 3, 'heading' => 'Item 3', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => lightspeed_get_placeholder_images( 2 ) ), array( 'id' => 4, 'heading' => 'Item 4', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => lightspeed_get_placeholder_images( 3 ) ), ); return $items; } function lightspeed_get_placeholder_items_without_images() { $items = array( array( 'id' => 1, 'heading' => 'Item 1', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => null ), array( 'id' => 2, 'heading' => 'Item 2', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => null ), array( 'id' => 3, 'heading' => 'Item 3', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => null ), array( 'id' => 4, 'heading' => 'Item 4', 'introduction' => lightspeed_get_placeholder_introduction(), 'include_cta' => false, 'cta' => null, 'cta_size' => null, 'url' => null, 'opensInNewTab' => null, 'heading_color' => null, 'introduction_color' => null, 'cta_color' => null, 'background_color' => null, 'video' => null, 'image' => null ), ); return $items; } function lightspeed_get_placeholder_images( $key = null ) { $directory = get_option( 'areoi-lightspeed-company-stock-media', 'default' ); $images = array( array( 'id' => 1, 'title' => 'image-1', 'filename' => 'image-1.jpg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/image-1.jpg', 'mime' => 'image/jpeg', 'type' => 'image', 'subtype' => 'jpeg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 2, 'title' => 'image-2', 'filename' => 'image-2.jpg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/image-2.jpg', 'mime' => 'image/jpeg', 'type' => 'image', 'subtype' => 'jpeg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 3, 'title' => 'image-3', 'filename' => 'image-3.jpg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/image-3.jpg', 'mime' => 'image/jpeg', 'type' => 'image', 'subtype' => 'jpeg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 4, 'title' => 'image-4', 'filename' => 'image-4.jpg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/image-4.jpg', 'mime' => 'image/jpeg', 'type' => 'image', 'subtype' => 'jpeg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), ); if ( $key !== null ) return $images[$key]; return $images; } function lightspeed_get_placeholder_videos( $key = null ) { $directory = get_option( 'areoi-lightspeed-company-stock-media', 'default' ); $videos = array( array( 'id' => 1, 'title' => 'video-1', 'filename' => 'video-1.mp4', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/video-1.mp4', 'mime' => 'video/mp4', 'type' => 'video', 'subtype' => 'mp4', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 2, 'title' => 'video-2', 'filename' => 'video-2.mp4', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/video-2.mp4', 'mime' => 'video/mp4', 'type' => 'video', 'subtype' => 'mp4', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 3, 'title' => 'video-3', 'filename' => 'video-3.mp4', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/video-3.mp4', 'mime' => 'video/mp4', 'type' => 'video', 'subtype' => 'mp4', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 4, 'title' => 'video-4', 'filename' => 'video-4.mp4', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/' . $directory . '/video-4.mp4', 'mime' => 'video/mp4', 'type' => 'video', 'subtype' => 'mp4', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), ); if ( $key !== null ) return $videos[$key]; return $videos; } function lightspeed_get_placeholder_logos() { $videos = array( array( 'id' => 1, 'title' => '3d-square', 'filename' => '3d-square.svg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/default/3d-square.svg', 'mime' => 'image/svg', 'type' => 'image', 'subtype' => 'svg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 2, 'title' => 'shapey', 'filename' => 'shapey.svg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/default/shapey.svg', 'mime' => 'image/svg', 'type' => 'image', 'subtype' => 'svg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 3, 'title' => 'speech', 'filename' => 'speech.svg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/default/speech.svg', 'mime' => 'image/svg', 'type' => 'image', 'subtype' => 'svg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 4, 'title' => 'triangle-creative', 'filename' => 'triangle-creative.svg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/default/triangle-creative.svg', 'mime' => 'image/svg', 'type' => 'image', 'subtype' => 'svg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), array( 'id' => 5, 'title' => 'waves', 'filename' => 'waves.svg', 'url' => '' . AREOI__PLUGIN_LIGHTSPEED_URI . 'assets/placeholders/default/waves.svg', 'mime' => 'image/svg', 'type' => 'image', 'subtype' => 'svg', 'height' => 1280, 'width' => 1920, 'alt' => 'Placeholder Image' ), ); return $videos; }