Remove Metabox Inline CSS From the DOM

Support General Remove Metabox Inline CSS From the DOM

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47773
    CodogCodog
    Participant

    Hi there,
    I would like to dequeue some inline CSS added by your plugin. I see the following inline style ID's in the DOM I wish to dequeue:

    - rwmb-inline-css
    - rwmb-input-inline-css
    - rwmb-input-list-inline-css
    - rwmb-select-inline-css

    However, when using the suggested method from your documentation:

    
    function metabox_remove_styles() {
    
      wp_dequeue_style( 'rwmb-inline' );
      wp_dequeue_style( 'rwmb-input-inline' );
      wp_dequeue_style( 'rwmb-input-list-inline' );
      wp_dequeue_style( 'rwmb-select-inline' );
    
    }
    add_action( 'rwmb_enqueue_scripts', 'metabox_remove_styles', 99 );
    

    This does not dequeue these inline styles? I would be very grateful if you can provide the methodology for removing these.

    I look forward to your response 🙂

    #47780
    PeterPeter
    Moderator

    Hello,

    They are not a handle script name in the Meta Box source code so you cannot dequeue the non-existed handle name.
    If you don't want to use the inline style of Meta Box, you can create some custom CSS code to override its style.

    #47782
    CodogCodog
    Participant

    Hi Peter,
    thanks for getting back to me. So what are the existing "script handle names" then? These...

    
    function metabox_remove_styles() {
    
      wp_dequeue_style( 'rwmb' );
      wp_dequeue_style( 'rwmb-input' );
      wp_dequeue_style( 'rwmb-input-list' );
      wp_dequeue_style( 'rwmb-select' );
    
    }
    add_action( 'rwmb_enqueue_scripts', 'metabox_remove_styles', 99 );
    
    #47792
    PeterPeter
    Moderator

    Yes, they are correct handle names rwmb rwmb-input rwmb-input-list ...

    you can find them in the meta-box plugin folder. Refer to the WordPress documentation
    https://developer.wordpress.org/reference/functions/wp_enqueue_style/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.