ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
922 stars 217 forks source link

Conflict With WooCommerce Meta box #569

Closed AminulBD closed 9 years ago

AminulBD commented 9 years ago

Take a look in this screenshot: screenshot from 2015-05-18 15 12 36

This happens, When I'm trying to add a meta box in 'product' post type of woocommerce.

dylan-ngo11 commented 9 years ago

I guess that it's conflict with jquery-ui of woocomerce, you can try to disable by add this script to functions.php

add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );

function child_manage_woocommerce_styles() {
    //remove generator meta tag
    remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );

    //first check that woo exists to prevent fatal errors
    if ( function_exists( 'is_woocommerce' ) ) {
        //dequeue scripts and styles
        if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
            wp_dequeue_script( 'jqueryui' );
        }
    }

}
AminulBD commented 9 years ago

Your code not working because it not conflicted with jquery-ui js, it's conflicted with jquery-ui-style-css. When i remove this this style it's working perfect. But unfortunately wp_dequeue_style not working for dashboard.

valeriuzdrobau commented 9 years ago

File jquery-ui.css is included from WooCommerce. To rule it out, try the following code:

add_action( 'admin_enqueue_scripts', '_action_theme_remove_jquery_ui_css', 99 );

function _action_theme_remove_jquery_ui_css() {

    if ( class_exists( 'WooCommerce' )  ) {
        wp_dequeue_style( 'jquery-ui-style' );
    }
}