Fatal error when the filter term_link is called
-
Hello,
in the file classes/Course_Filter.php you have this code at line 56:
add_filter( 'term_link', __CLASS__ . '::filter_course_category_term_link', 10, 3 );
But the method filter_course_category_term_link accepts only a WP_Term as $term, and you are passing a standard class when you add your filter.
public static function filter_course_category_term_link( string $termlink, \WP_Term $term, string $taxonomy ) { if ( 'course-category' === $taxonomy ) { $termlink = add_query_arg( 'tutor-course-filter-category', $term->term_id, $termlink ); } return $termlink; }
So, everytime your filter is called, you have a fatal error.
This is what happens in a backend page of Freesoul Deactivate Plugins, where there is a fatal error because FDP just calls the function get_term_link, and inside get_term_link you have a call to the filter term_link.
Can you please correct your code?
Have a great day
Jose
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Fatal error when the filter term_link is called’ is closed to new replies.