• Resolved eclev91

    (@eclev91)


    Due to what appears to be some kind of WPML conflict, your plugin calls:

    remove_action('template_redirect', 'redirect_canonical');

    You subsequently re-enable it, but you do that by explicitly calling redirect_canonical().

    This means that anyone else who was disabling canonical redirects using the same call to remove_action that you just used will be ignored and those redirects will happen anyway.

    You should be able to hook in before WordPress’s default calls to redirect_canonical and do what you need to do (looks like setting some $_SERVER variables) without turning the action off and back on. This would preserve anyone else’s ability to disable canonical redirects entirely, if they so choose.

    Same thing for wp_old_slug_redirect.

    • This topic was modified 5 years, 8 months ago by eclev91.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @eclev91

    We need to chat about this with our developers.
    Do you have an active testing site we can use?
    We may need to deactivate plugins and switch the theme while troubleshooting temporarily. Would you feel OK with that? If so, please send us a bug report here: https://www.imagely.com/report-bug, refer back to this forum thread and let them know Gaby referred you.

    Thanks!

    – Gaby, Customer Support.

    Thread Starter eclev91

    (@eclev91)

    Hey there,

    It’s a pretty edge case, so that may be what we want to do. Filling out report now.

    Hi @eclev91

    Thank you so much for that report.
    We are waiting for some feedback from one of our developers.
    We’ll keep you posted.

    – Gaby, Customer Support.

    Why we do the things we are is complicated to explain but it can be easily resolved by adding the following two lines to the theme’s functions.php:

    if (class_exists('M_WordPress_Routing'))
    M_WordPress_Routing::$_use_canonical_redirect = FALSE;
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ability to disable redirect_canonical() not properly restored’ is closed to new replies.