• Resolved RomSocial

    (@romsocial)


    term_link filter expects url string.
    But after some refactoring it might contain the WP_Error.

    Some plugins (e.g. WPML) expect the string, and generate PHP Warning, trying to apply string functions to the WP_Error object.

    Maybe the filter should not be called if it is WP_Error, and return WP_Error without calling filter?

    Alternatively, the documentation could be updated to say it could pass the WP_Error to a filter.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    But that error (line 4191) returns immediately, bypassing the filter. The filter should never pass an error object, however calling get_term_link() could very well return an error. It’s the responsibility of the caller to anticipate this possibility. That possibility is documented.

    If the filter is passing an error object, it probably was passed inappropriately from other filter hooks.

    Thread Starter RomSocial

    (@romsocial)

    Thanks, I agree that seems like the issue is mostly in my version of WPML.
    I’ll need to investigate it further.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Taxonomy’ is closed to new replies.