Add Elementor event loop preset library and separate releases
This commit is contained in:
35
addons/eventlabs-loop-builder/includes/starter-layout.php
Normal file
35
addons/eventlabs-loop-builder/includes/starter-layout.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$field = static function ( string $key, array $settings = [] ): array {
|
||||
return [
|
||||
'id' => Elementor\Utils::generate_random_string(), 'elType' => 'widget', 'widgetType' => 'eventlabs-loop-field',
|
||||
'settings' => [ 'field' => $key ] + $settings, 'elements' => [],
|
||||
];
|
||||
};
|
||||
$container = static function ( string $classes, array $children, bool $inner = true ): array {
|
||||
return [
|
||||
'id' => Elementor\Utils::generate_random_string(), 'elType' => 'container', 'isInner' => $inner,
|
||||
'settings' => [ 'content_width' => 'full', 'css_classes' => $classes ], 'elements' => $children,
|
||||
];
|
||||
};
|
||||
|
||||
$body = $container( 'ell-starter-body', [
|
||||
$field( 'categories' ),
|
||||
$field( 'schedule' ),
|
||||
$field( 'title' ),
|
||||
$field( 'venue' ),
|
||||
$field( 'excerpt' ),
|
||||
$container( 'ell-starter-meta', [ $field( 'cost' ), $field( 'status' ) ] ),
|
||||
$field( 'link' ),
|
||||
] );
|
||||
|
||||
return [
|
||||
'compact' === $preset
|
||||
? $container( 'ell-starter ell-starter-compact', [ $body ], false )
|
||||
: $container( 'ell-starter ell-starter-photo', [
|
||||
$container( 'ell-starter-media', [ $field( 'image', [ 'show_placeholder' => 'yes' ] ) ] ),
|
||||
$body,
|
||||
], false ),
|
||||
];
|
||||
Reference in New Issue
Block a user