• Resolved Nate Zander

    (@mtnporcupine)


    Hello-

    Thanks for an awesome plugin. It’s great to have these ready made blocks out of the box so we don’t have to create our own.

    We’re using your tabs block to mimic Bootstrap 4 Tabs. We already have our styles set up for tabs built into our theme, so now I have to override the styles the come with Kadence Blocks.

    Do you have a tutorial on how to unregister styles for this plugin? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Nate Zander

    (@mtnporcupine)

    Looks like the old PHP way works. Perhaps this is best practice? (This unregisters ALL styles for the plugin, not just tabs)

    function my_enqueue_scripts() {
      wp_dequeue_style( 'kadence-blocks-style-css' );
    }
    
    add_action("wp_enqueue_scripts", "my_enqueue_scripts");
    Thread Starter Nate Zander

    (@mtnporcupine)

    BUT, the inline styles are still added. So would still love some help on unregistering those. Thanks!

    Hey,
    Thanks for posting, I’m planning to make it so individual block styles can be pulled out but currently dequeuing all is what you would have to do.

    In terms of the output based on settings you choose in the block this doesn’t really have an off switch. I’ll add a hook that allows you to turn it off with a switch in the next update. Here is how it would work for you to unhook:

    /**
     * Function to turn off inline tabs block css.
     *
     * @param bool   $enable is on of off.
     * @param string $type the name of the block.
     * @param string $uniqueid the unique id of the block.
     */
    function custom_turn_off_tabs_inline_css( $enable, $type, $uniqueid ) {
    	if ( 'tabs' === $type ) {
    		$enable = false;
    	}
    	return $enable;
    }
    add_filter( 'kadence_blocks_render_inline_css', 'custom_turn_off_tabs_inline_css', 10, 3 );

    Ben

    Thread Starter Nate Zander

    (@mtnporcupine)

    Awesome.

    Thanks again for the great plugin!

    • This reply was modified 5 years, 7 months ago by Nate Zander. Reason: Marked as resolved
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unregister Styles?’ is closed to new replies.