Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Toolbar Extras plugin: Unload also translations for the Elementor Add-On "Premium Addons for Elementor" (free, by Leap13) --- website: https://toolbarextras.com
<?php
/** Do NOT include the opening php tag */
/** Version 1 - strict unloading */
if ( ! function_exists( 'ddw_tbex_unload_textdomain_premium_addons' ) ) :
add_action( 'init', 'ddw_tbex_unload_textdomain_premium_addons' );
/**
* Unload Textdomain for plugin(s):
* - "Premium Addons for Elementor" (free, by Leap13)
* - "Premium Addons PRO" (Add-On) (Premium, by Leap13)
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/af1b2d549fc33e0f04bdcea277aef6ba
* @link https://toolbarextras.com
*/
function ddw_tbex_unload_textdomain_premium_addons() {
unload_textdomain( 'premium-addons-for-elementor' );
unload_textdomain( 'premium-addons-pro' );
} // end function
endif;
<?php
/** Do NOT include the opening php tag */
/** Version 2 - unloading only for logged-in administrator users */
if ( ! function_exists( 'ddw_tbex_unload_textdomain_premium_addons' ) ) :
add_action( 'init', 'ddw_tbex_unload_textdomain_premium_addons' );
/**
* Unload Textdomain for plugin(s):
* - "Premium Addons for Elementor" (free, by Leap13)
* - "Premium Addons PRO" (Add-On) (Premium, by Leap13)
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/af1b2d549fc33e0f04bdcea277aef6ba
* @link https://toolbarextras.com
*/
function ddw_tbex_unload_textdomain_premium_addons() {
if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
unload_textdomain( 'premium-addons-for-elementor' );
unload_textdomain( 'premium-addons-pro' );
} // end if
} // end function
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment