Elementor 2.9

URI Protocols Handling Update

Elementor has now updated the way it handles URLs in the URL control.

From v2.9.11 and on, Elementor will use the use wp_allowed_protocols() function to handle allowed URI protocols in links. These protocols are often used to create a deep-link (i.e. a direct link to an app via unique protocol) to a 3rd party application (such as mailto: or tel:)

This means that from this version, only protocols allowed by this WordPress function will be available.

Examples of allowed URI protocols: mailto:, tel:, sms:, etc…

If you wish to add another protocol to your website, you will need to alter the function that retrieves the list of allowed protocols, and add your own protocol.

function allow_additional_protocol( $protocols ){
     $protocols[] = 'my-protocol';
     return $protocols;
add_filter( 'kses_allowed_protocols' , 'allow_additional_protocol' );
Read More »

Swiper Update to 5.3.6 & New Wrapper Class

In Elementor Core 2.9.0, we integrated an update to the Swiper.js library used in all of Elementor’s carousels (Core and Pro). Up to 2.9.0, the included Swiper version was 4.4.6. In Elementor 2.9, the Swiper library was updated to version 5. This version includes potentially breaking changes. Please read on for more information.

Why Did We Update?

As part of standard maintenance, we update our external libraries from time to time, including Swiper. Swiper 4.4.6 was released in December 2018, and many issues and features were added in the current 5.3.6 version.

Major Changes From Swiper 4.x

The biggest change, for Elementor, which was introduced in Swiper 5.0, was an inversion of the library’s breakpoints system. Up until Swiper 5.x, the breakpoint system worked on a max-width basis: meaning, for a given breakpoint (say, 768px), a given setting would be implemented on all screen widths under 768px.

In Swiper 5.x, the library author changed the breakpoints system to work on a min-width basis. Meaning, for a given breakpoint (e.g. 768px), the given setting would be implemented on all screen widths above 768px. There used to be an option to actively invert the breakpoint system (an optional parameter), but the library author removed that option for reasons unbeknownst to us.

It is important to understand – this is a breaking change for anyone using the Swiper library for their custom widgets. Please read the entire article in order to be sure you take the necessary action to keep your Elementor add-ons working properly.


Read More »

All Swiper.js Instances in Elementor are Now Exposed

Elementor uses Swiper, an external JS library, to power all of the sliders and carousels in the editor. Swiper has an extensive API which provides methods and events which can be utilized to control and manipulate the slider/carousel and its behavior.

Up until Elementor 2.9.0, the Swiper instances used in our widgets and other features were contained in our JS handler classes and not exposed in the front end. 

Following requests from our developer user base, we have decided to make all of the Swiper instances used in Elementor and Elementor Pro available in the frontend.

Swiper uses the class 'swiper-container' in the slider wrapper element. Starting in Elementor 2.9.0, the Swiper instance will now be available in the cache of this element’s jQuery instance. 

To access a slider or carousel’s Swiper instance, create a jQuery instance targeting the slider’s container, and query the element’s data cache with the key 'swipe'

How to Access a Swiper Instance

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' );

The swiperInstance constant now holds a reference to our carousel’s Swiper instance. You can now call Swiper methods on this variable, add event listeners, and generally taking advantage of everything the Swiper API has to offer.

Usage Example

Here is an example code snippet you can use to change the active slide to the slide of your choice. Replace #my-id with your ID/class, and replace 0 with the slide number you want to change to:

const imageCarousel = jQuery ( '#my-id .swiper-container' ),
swiperInstance = imageCarousel.data( 'swiper' );
swiperInstance.slideTo( 0 );

Open the page with your image carousel (in the frontend), paste this into your developer console and run it to change the active slide to the slide of your choice.

Read More »

v2.9.0: Planned Deprecations

Hey all! we are getting ready to release version 2.9.

If you are a developer who extends Elementor please review the below changes to keep your plugin up and running.

Here is the planned deprecations:

(more…) Read More »

Migration of Modules from Pro to Core in Elementor 2.9

In order to support new features in Elementor, we are moving the Link Actions module and the Social Share JS library from Elementor Pro into the Core version.

Link Actions

The Link Actions module allowed attaching Elementor event triggers to button links. For example, a hash could be added to a button link to trigger the opening/closing of a popup.

Up until Elementor and Elementor Pro 2.9.0, Link Actions existed as an Elementor Pro module located in the elementor-pro/modules/link-actions directory. In 2.9.0, we split the Link Actions module up into two separate parts and moved it to the Elementor Core plugin.


The PHP part of the Link Actions module was moved to the elementor/includes/frontend.php file. The original method, create_action_url, was replaced by a new method called create_action_hash, which accepts two parameters: an action (to perform on click), and additional settings related to the action:
create_action_hash( $action, array $settings ).

PHP Examples:

Deprecated Implementation:

\ElementorPro\Modules\LinkActions\Module::create_action_url( 'popup:open', [
	'id' => $settings['popup'],
	'toggle' => 'toggle' === $settings['action'],
] );

New Implementation:

\Elementor\Plugin::$instance->frontend->create_action_hash( 'popup:open', [
	'id' => $settings['popup'],
	'toggle' => 'toggle' === $settings['action'],
] );


The JS handler was located at elementor-pro/modules/link-actions/assets/js/frontend/frontend.js. moved to the JS utils folder at elementor/assets/dev/js/frontend/utils/url-actions.js. The handler runs by default on all elementor pages, scans links for actions, and if it finds any, it executes them. The script is mostly unchanged. Feel free to check out the source code in the GitHub repo.

JS Examples – Adding a link action:

Deprecated Implementation:

elementorProFrontend.modules.linkActions.addAction( 'popup:open',() => { 
// Do your action here
} );

New Implementation:

elementorFrontend.utils.urlActions.addAction( 'popup:open', () => 
// Do your action here
} );

Social Share (now Share Link)

The Social Share library enabled the integration of social sharing capabilities into some Elementor Pro widgets.

The library generates custom share links to a variety of social networks and exists both as an object on the global scope (object name: ShareLink), as well as a jQuery plugin (method name jQuery.fn.shareLink()).

Nothing has changed in the library’s functionality or the way it is used. To familiarize yourself with the library, feel free to visit the library’s source code on Elementor’s GitHub page: https://github.com/elementor/elementor.

Up until Elementor and Elementor Pro 2.9.0, Social Share existed as a library hosted in Elementor Pro (elementor-pro/assets/lib/social-share/social-share.js). In 2.9.0, we changed the file name to better reflect the library’s functionality and moved it to the Elementor Core plugin.

The newly named Share Link library is now located in elementor/assets/lib/share-link/

Read More »

Never miss an update
Subscribe to our developer’s newsletter for every latest update