URI Protocols Handling Update

Cover image

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' );
Share on facebook
Share on twitter
Share on linkedin

Author

Shilo Eish Yemini
Shilo Eish Yemini
Shilo is Elementor’s Editor Product Lead. He loves innovative products, pays attention to the small details, and is passionate about solving puzzles.

Comments

One Response

  1. Tried adding BTC protocol this way and the result is that in the “list” widget no matter the “Allow function” it just doesn’t work!

Leave a Reply

Your email address will not be published. Required fields are marked *