hook_from_learndash() ) { return $filename; } return $return; } /** * Determine where we hook from * We need to do this only for something specific in LearnDash plugin * * @return bool */ private function hook_from_learndash() { $call_stack = debug_backtrace(); if( !empty($call_stack[6]['function']) && $call_stack[6]['function'] == 'sanitize_file_name' && ( strpos( $call_stack[6]['file'], 'class-ld-semper-fi-module.php' ) || strpos( $call_stack[6]['file'], 'class-ld-cpt-instance.php' ) ) ) { return true; } return false; } } } }