[Resolved] 'generate_construct_footer_widgets'

Home Forums Support [Resolved] 'generate_construct_footer_widgets'

Home Forums Support 'generate_construct_footer_widgets'

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #603668
    David

    Hi, everyone:

    I’ve tried to remove the action ‘generate_construct_footer_widgets’ attached to ‘generate_footer’ action name so I can remove the widgets part. No matter What I do I’m not able to get it right, also tried setting priority number but nothing changes.

    I know customizer does it, but that’s not what I’m after. Does anyone know how to remove those widgets?

    Here’s my code in functions.php

    add_action( 'after_setup_theme', 'remove_gp_parts' );
    function remove_gp_parts {
      remove_action( 'generate_footer', 'generate_construct_footer_widgets' );
    }

    Thanks in advance.

    #604043
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this instead:

    add_action( 'after_setup_theme', 'remove_gp_parts' );
    function remove_gp_parts {
      remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
    }

    If the add_action() has a priority, the remove_action() has to as well.

    #604116
    David

    Hi Tom,

    Great, that worked! Adding '5' priority to add_action() did it:

    add_action( 'after_setup_theme', 'remove_gp_parts', 5 );

    Tank you so much for your help!

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