I am trying to unhook and modify an action from within my child themes functions.php file.
The WordPress plugin Sensei, adds this action in line 86 of this document.
https://github.com/Automattic/sensei/blob/master/includes/class-sensei-modules.php#L86
The action references a function further down the page that is responsible for outputting a dynamic header element.
/**
* Show the title modules on the single course template.
*
* Function is hooked into sensei_single_course_modules_before.
*
* @since 1.8.0
* @return void
*/
public function course_modules_title( ) {
if( sensei_module_has_lessons() ){
echo '<header><h2>' . __('Modules', 'woothemes-sensei') . '</h2></header>';
}
}
My goal here is to change the html currently output as 'Modules' to something else.
I have tried to the following in my child themes functions.php file but neither seem to be working.
remove_action( 'sensei_single_course_modules_before', array( 'Sensei_Core_Modules', 'course_modules_title' ), 20);
remove_action( 'sensei_single_course_modules_before', array( 'Sensei()->Sensei_Core_Modules', 'course_modules_title' ), 20);
The issue is, I do not know how to determine which initial parameter, to add to the array to call the correct class. Because I am accessing it externally I cannot use $this
like it is being used in the core file.