This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Element to slide gets the following CSS: | |
max-height: 0; | |
opacity: 0; | |
overflow: hidden; | |
transition: max-height 0.4s ease 0s; | |
*/ | |
/** | |
* Like jQuery's slideDown function - uses CSS3 transitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//plugins/axios.js | |
export default function ({ $axios, app }) { | |
$axios.onError(error => { | |
const code = parseInt(error.response && error.response.status) | |
if ([401, 403].includes(code)) { | |
app.$auth.logout(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Include your JS into a normal file, just how you are used to and enqueue it with wp_enqueue_script. This will not work in the editor, because you want the functions to fire when you add them. | |
At the beginning of your widget file, add ‘use Elementor\Plugin;’. | |
Then at the end of the render() function in your PHP, add this: | |
<?php if ( Plugin::$instance->editor->is_edit_mode() ) : ?> | |
<script>Your code here</script | |
<?php |
NewerOlder