• Resolved Jose

    (@giuse)


    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)
  • Dear @giuse

    We sincerely apologize for the inconvenience you’ve encountered. However, the issue does not originate from our code. It appears to be a conflict stemming from the other plugin in use, and as such, we are unable to modify our code to accommodate it. Altering our code could potentially cause issues for themes and users who have customized our template. We hope you can appreciate our position in this matter.

    Thank you.

    Thread Starter Jose

    (@giuse)

    Hello,

    the other plugin only uses the filter term_link, nothing else.

    Read again my comment. Of course, with PHP 8 and above you have a fatal error. It’s enough to call the filter term_link, no matter who calls that filter. In this case, it was the other plugin, but whatever uses the core function term_link will trigger a fatal error due to the code of your plugin.

    If you are serious about your plugin, I suggest you check again your code.

    For me this thread is not solved. I will open it again.

    Have a great day!

    Jose

    rdk21

    (@rkanka21)

    Facing the same error as Jose.

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.