• Pamela

    (@infoknutsford-softwarecouk)


    I am trying to remove an action but it isn’t being removed

    This is what I have in functions.php

    
    add_action( 'sensei_single_quiz_questions_after', 'remove_action_buttons', 10, 0 );
    
    function remove_action_buttons() {
    		
        	remove_action( 'sensei_single_quiz_questions_after', array( 'Sensei_Quiz', 'action_buttons' ), 10, 0  );
    	
    }
    	
    add_action( 'sensei_single_quiz_questions_after', 'new_action_buttons' );
    
    function new_action_buttons() {
    
    

    The original add action is

    add_action( ‘sensei_single_quiz_questions_after’, array( ‘Sensei_Quiz’, ‘action_buttons’ ), 10, 0 );

    It is definitely going into the function that calls the remove but the buttons are still there on the page. It calls the replacement ok and adds those buttons. Thanks

The topic ‘remove action not working’ is closed to new replies.