• Resolved sebastianlaube

    (@sebastianlaube)


    Hi,
    I am theme developer and won’t need any of your plugins inline CSS (<style> in wp-head). It’s defined in the instance function.

    Please suggest a way to remove it from wp-head. Using the following code in functions.php won’t help:

    remove_action(
        'wp_head',
        array( 'Multi_Rating::instance()', 'add_custom_css' )
    );

    https://wordpress.org/plugins/multi-rating/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sebastianlaube

    (@sebastianlaube)

    Finally figured out. Sorry for the distraction.

    // remove inline styles from rating plugin
    if ( function_exists( 'mr_multi_rating' ) ) {
        remove_action(
            'wp_head',
            array( mr_multi_rating(), 'add_custom_css' )
        );
    }

    For the developers who are interested:

    // remove rating css file
    wp_deregister_style( 'mr-frontend-style' );
    
    // remove rating js
    wp_deregister_script( 'mr-frontend-script' );

    Now you can concat your scripts and styles or write your own implementation.

    Plugin Author dpowney

    (@dpowney)

    Hi there,

    There’s an option in the Pro version to disable styles (but not for the custom CSS function). I’ll add it to the free version. I don’t want to clutter the free version with too many options (not to limit anything but to keep things simple and easy to understand for the average user).

    Cheers,
    Daniel

    Plugin Author dpowney

    (@dpowney)

    OK I’ve just released v4.2 which has an option to disable styles. Note that I changed the function name from add_custom_css to mr_head so your code above needs to also change.

    Daniel

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get rid of inline styles’ is closed to new replies.