Last active
December 20, 2024 08:56
-
-
Save chairmanbrando/320f05c066ee44f89d3e1a595526890f to your computer and use it in GitHub Desktop.
Disable Elementor's AI prompts, links, and buttons
This file contains hidden or 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
<?php | |
// For whatever reason, returning `false` isn't good enough. 🤷♀️ | |
add_filter('get_user_option_elementor_enable_ai', fn () => '0', PHP_INT_MAX); |
I forgot PHP has had arrow functions for a bit, so here's one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The previous version dequeued the relevant scripts, but that was before Elementor had a per-user setting to disable the AI. Rather than setting it for each user, simply override the value and return "false" for everyone.