Skip to content

Instantly share code, notes, and snippets.

View mariusgnicula's full-sized avatar

Marius Nicula mariusgnicula

View GitHub Profile
@mariusgnicula
mariusgnicula / 2026-05-18-page-builder-ai-first.html
Last active May 19, 2026 15:34
Rethinking the Page Builder — mio-hub MIO-384 (2026-05-18 presentation)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rethinking the Page Builder — mio-hub MIO-384</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
@mariusgnicula
mariusgnicula / gist:2261bb9548ef1a5388704bf0ef02528b
Created October 11, 2017 07:33
How to include JS into custom Elementor Widget
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