remove_action not working, even after changing priority

This question already has an answer here:

  • remove_action or remove_filter with external classes?

    4 answers

Solutions Collecting From Web of "remove_action not working, even after changing priority"

You are trying to unhook a PHP function as opposed to a (class) instance method – see here:

array( $this, 'job_manager_job_filters_distance' )

…that’s the actual callback registered to the hook. To unhook you need the same (a reference to the instance).

If you are trying to unhook from within the class, it’s as easy as using the above. Otherwise you need a reference to the instance – look for something like the following in your code:

$my_class = new Name_Of_Class;

…then you’d run:

remove_action( 'job_manager_job_filters_search_jobs_end', array( $my_class, 'job_manager_job_filters_distance' ) , 0 );