• Hi,

    I would like to remove an action from the twentytwenty one parent theme class.

    This is the class : Twenty_Twenty_One_Dark_Mode

    this is the action : add_action( ‘wp_footer’, array( $this, ‘the_switch’ ) );

    I tried this way

    function remove_darkmode_switch_parent() {
        global $darkmode_parent;
        remove_action('wp_footer', array($darkmode_parent, 'the_switch' ));
    }
    
    add_action( 'after_setup_theme', 'remove_darkmode_switch_parent',0);

    but no luck.

    Once I got it removed I will be able to extend the class my own way.

    Cheers for any clue. Otherwise i’ll use jQuery to custom the button.

    • This topic was modified 2 years, 7 months ago by futur3int.
    • This topic was modified 2 years, 7 months ago by futur3int.
    • This topic was modified 2 years, 7 months ago by futur3int.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You can disable dark mode support from the customizer.

    Thread Starter futur3int

    (@futur3int)

    Hi bc,

    I guess if I disable the whole dark mode support I won’t be able to custom it anymore.

    Whatever best solution to rewrite the design is with jQuery.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘remove twentytwenty one dark mode switch action’ is closed to new replies.