elementor / elementor/elementor
Can not access exposed Swiper Instance
- Dominant language
- PHP
- Stars
- 7.1k
- Forks
- 1.6k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 193
Description
## Prerequisites
- [x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [x] The issue still exists against the latest stable version of Elementor.
## Description
as described here: https://developers.elementor.com/expose-swiper-in-elementor/ this does not work as already answered in the comments of the article. the example code always returns "undefined". Probably there is the need to wait for a certain event to call for.
## Steps to reproduce
1. Add an image carousel to an Elementor page/post.
2. Edit the widget > Go to Advanced > Advanced
3. Give the widget a unique class name/ID in the “CSS ID” or “CSS Classes” field.
4. In your Javascript file, create a jQuery instance of the carousel’s 'swiper-container' element using the ID/class you chose and the 'swiper-container' class (replace #my-id with your ID/class):
const imageCarousel = jQuery ( '#my-id .swiper-container' );
5. Now, get the Swiper instance by querying your carousel instance’s data cache using the key 'swiper':
const swiperInstance = imageCarousel.data( 'swiper' );
write console.log(swiperInstance);
## Isolating the problem
- [x] This bug happens with only Elementor plugin active (and Elementor Pro).
- [x] This bug happens with a default WordPress theme active.
- [x] I can reproduce this bug consistently using the steps above.
## Environment
System Info
```
== Server Environment ==
Operating System: Linux
Software: Apache
MySQL version: mariadb.org binary distribution v10.5.11
PHP Version: 8.0.6
PHP Max Input Vars: 3000
PHP Max Post Size: 200M
GD Installed: Yes
ZIP Installed: Yes
Write Permissions: All right
Elementor Library: Connected
== WordPress Environment ==
Version: 5.8
Site URL: https://vivorino.de
Home URL: https://vivorino.de
WP Multisite: No
Max Upload Size: 200 MB
Memory limit: 256M
Permalink Structure: /%postname%/
Language: en-US
Timezone: Europe/Berlin
Debug Mode: Inactive
== Theme ==
Name: Hello Elementor Child
Version: 1.0.1
Author: Elementor Team
Child Theme: Yes
Parent Theme Name: Hello Elementor
Parent Theme Version: 2.4.1
Parent Theme Author: Elementor Team
== User ==
Role: administrator
WP Profile lang: de_DE
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
== Active Plugins ==
DynamicConditions
Version: 1.5.1
Author: RTO GmbH
Elementor
Version: 3.3.1
Author: Elementor.com
Elementor Pro
Version: 3.3.5
Author: Elementor.com
Email Templates
Version: 1.3.2.1
Author: Damian Logghe
Happy Elementor Addons
Version: 2.27.0
Author: weDevs
Happy Elementor Addons Pro
Version: 1.19.2
Author: weDevs
HappyFiles Pro
Version: 1.5.1
Author: Codeer
Material Design Icons for Page Builders
Version: 1.3.2
Author: Photon WP
OoohBoi Steroids for Elementor
Version: 1.7.8
Author: OoohBoi
Password Protected
Version: 2.4
Author: Ben Huson
TablePress
Version: 1.14
Author: Tobias Bäthge
TablePress Extension: Responsive Tables
Version: 1.8
Author: Tobias Bäthge
TablePress Extension: Row Filtering
Version: 1.3
Author: Tobias Bäthge
WP Migrate DB Pro
Version: 2.0.4
Author: Delicious Brains
WP Migrate DB Pro Media Files
Version: 2.0.2
Author: Delicious Brains
== Must-Use Plugins ==
WP Migrate DB Pro Compatibility
Version: 1.2
Author: Delicious Brains
== Elementor - Compatibility Tag ==
Elementor Pro: Compatibility not specified
Happy Elementor Addons: Compatibility not specified
Happy Elementor Addons Pro: Compatibility not specified
OoohBoi Steroids for Elementor: Compatibility not specified
== Elementor Pro - Compatibility Tag ==
== Elements Usage ==
archive : 3
button : 4
heading : 5
image : 1
post-info : 2
posts : 3
text-editor : 3
theme-archive-title : 1
video : 1
footer : 1
form : 1
heading : 6
icon-list : 4
image : 1
nav-menu : 1
text-editor : 2
header : 1
button : 8
heading : 31
icon : 1
icon-list : 1
image : 1
popup : 2
shortcode : 1
section : 2
button : 3
heading : 1
html : 1
image : 1
wp-page : 30
blockquote : 1
button : 265
counter : 2
form : 2
ha-content-switcher : 3
ha-logo-grid : 7
ha-testimonial-carousel : 4
heading : 537
hotspot : 12
html : 1
icon : 5
icon-box : 15
icon-list : 58
image : 232
image-gallery : 1
posts : 4
progress : 3
slides : 1
spacer : 5
tabs : 14
text-editor : 266
video : 16
single-post : 4
author-box : 1
button : 9
form : 1
heading : 13
icon-list : 1
image : 3
post-comments : 1
post-info : 4
posts : 2
text-editor : 7
theme-post-content : 4
theme-post-excerpt : 2
theme-post-featured-image : 2
theme-post-title : 2
error-404 : 1
heading : 3
search-form : 1
== Log ==
Log: showing 20 of 302021-03-29 17:41:31 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor Pro',
'from' => '2.8.3',
'to' => '3.2.1',
)]
2021-06-29 11:54:37 [info] elementor::elementor_updater Started
2021-06-29 11:54:37 [info] Elementor/Upgrades - _v_3_2_0_migrate_breakpoints_to_new_system Start
2021-06-29 11:54:37 [info] Elementor/Upgrades - _v_3_2_0_migrate_breakpoints_to_new_system Finished
2021-06-29 11:54:37 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor',
'from' => '3.1.4',
'to' => '3.2.5',
)]
2021-06-29 11:54:37 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor',
'from' => '3.1.4',
'to' => '3.2.5',
)]
2021-06-29 15:52:09 [info] elementor-pro::elementor_pro_updater Started
2021-06-29 15:52:09 [info] Elementor Pro/Upgrades - _v_3_3_0_nav_menu_icon Start
2021-06-29 15:52:09 [info] Elementor Pro/Upgrades - _v_3_3_0_nav_menu_icon Finished
2021-06-29 15:52:09 [info] Elementor Pro/Upgrades - _v_3_3_0_recalc_usage_data Start
2021-06-29 15:52:09 [info] Elementor Pro/Upgrades - _v_3_3_0_recalc_usage_data Finished
2021-06-29 15:52:09 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor Pro',
'from' => '3.2.1',
'to' => '3.3.1',
)]
2021-06-29 15:52:09 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor Pro',
'from' => '3.2.1',
'to' => '3.3.1',
)]
2021-07-28 11:35:34 [info] elementor::elementor_updater Started
2021-07-28 11:35:34 [info] Elementor/Upgrades - _on_each_version Start
2021-07-28 11:35:35 [info] Elementor/Upgrades - _on_each_version Finished
2021-07-28 11:35:35 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor',
'from' => '3.2.5',
'to' => '3.3.1',
)]
2021-07-28 11:35:35 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor',
'from' => '3.2.5',
'to' => '3.3.1',
)]
2021-07-28 11:36:44 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor Pro',
'from' => '3.3.1',
'to' => '3.3.4',
)]
2021-08-03 12:42:07 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor Pro',
'from' => '3.3.4',
'to' => '3.3.5',
)]
PHP: showing 13 of 13PHP: 2021-03-31 05:14:31 [notice X 17][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor/core/common/modules/ajax/module.php::171] Undefined index: data [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-04-12 16:33:56 [notice X 1][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor/includes/managers/image.php::86] Trying to access array offset on value of type bool [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-06-29 14:19:28 [notice X 29][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor/includes/widgets/button.php::569] Undefined index: icon [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-06-29 15:51:33 [error X 2][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/elementor-pro.php::57] require(): Failed opening required '/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/plugin.php' (include_path='.:/usr/local/Cellar/php@7.4/7.4.20/share/php@7.4/pear') [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-06-30 08:33:19 [warning X 1][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor/includes/template-library/sources/local.php::893] rmdir(/www/htdocs/w00885cf/vivorino.de/wp-content/uploads/elementor/tmp/60dc102728148): Directory not empty [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-06-30 17:49:54 [notice X 1][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-extras/modules/breadcrumbs/widgets/breadcrumbs.php::1215] Required parameter $query follows optional parameter $post [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-01 10:32:06 [warning X 23][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor/core/common/modules/ajax/module.php::171] Undefined array key "data" [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-08 15:31:12 [warning X 1][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/query-control/module.php::382] Undefined array key "display" [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-08 16:37:06 [error X 1][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php::285] Uncaught Error: Call to a member function update_meta() on bool in /www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php:285
Stack trace:
#0 /www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php(166): ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->save_conditions(NULL, Array)
#1 [internal function]: ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->ajax_save_theme_template_conditions(Array, Object(Elementor\Core\Common\Modules\Ajax\Module))
#2 /www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor/core/common/modules/ajax/module.php(171): call_user_func(Array, Array, Object(Elementor\Core\Common\Modules\Ajax\Module))
#3 /www/htdocs/w00885cf/vivorino.de/wp-includes/class-wp-hook.php(292): Elementor\Core\Common\Modules\Ajax\Module->handle_ajax_request('')
#4 /www/htdocs/w00885cf/vivorino.de/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array)
#5 /www/htdocs/w00885cf/vivorino.de/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#6 /www/htdocs/w00885cf/vivorino.de/wp-admin/admin-ajax.php(187): do_action('wp_ajax_element...')
#7 /Users/nicb/.composer/vendor/laravel/valet/server.php(235): require('/Volumes/eSSD/_...')
#8 {main}
thrown [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-16 10:35:19 [warning X 5][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/forms/submissions/actions/save-to-database.php::94] Undefined array key "field_label" [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-16 12:59:23 [warning X 2][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/forms/classes/form-base.php::54] Undefined array key "required" [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-16 13:07:49 [warning X 2][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/forms/submissions/actions/save-to-database.php::93] Undefined array key "field_type" [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2021-07-22 14:52:22 [warning X 1][/www/htdocs/w00885cf/vivorino.de/wp-content/plugins/elementor-pro/modules/query-control/module.php::738] Attempt to read property "name" on null [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
```
Contributor guide
Assessment
This issue has not been assessed yet.