• Basisthema
  • Tweede menu item
    • Sub menu item
Inloggen
Home » Magento WordPress integratie – Widgets uitschakelen in WYSIWYG

Magento WordPress integratie – Widgets uitschakelen in WYSIWYG

Magento WordPress integratie – Widgets uitschakelen in WYSIWYG

Als je Wordpress erg traag wordt van alle Widgets die hij wil inladen vanuit

PHP Code

php
add_action('init', function () {
    // Loop through all callbacks for media_buttons
    global $wp_filter;
 
    if ( isset( $wp_filter['media_buttons'] ) ) {
        foreach ( $wp_filter['media_buttons']->callbacks as $priority => $callbacks ) {
            foreach ( $callbacks as $id => $callback ) {
 
                // Check if the callback belongs to M2I_Editor_Button
                if (
                    is_array($callback['function']) &&
                    is_object($callback['function'][0]) &&
                    get_class($callback['function'][0]) === 'M2I_Editor_Button'
                ) {
                    unset($wp_filter['media_buttons']->callbacks[$priority][$id]);
                }
 
            }
        }
    }
});
Voeg de snippet toe in je functions.php , om er voor te zorgen dat de Widgets niet wordt ingeladen. Zorgt namelijk voor enorme snelheidsverlies bij veel categories.
Bekijk Snippet

Door Gladior

  • Facebook
  • Linkedin
  • Mail
  • Instagram

Contact

service@gladior.com

Overige informatie

Basisthema voor WordPress