• Resolved rizbanr

    (@rizbanr)


    When using this plugin, previously, if multiple pages had the same URI set to them, the page with the lowest ID number (i.e. the earliest created) is the one that would be accessed on redirect. After updating, I find that this has been changed to redirect to the page with the highest ID (i.e. the most recently created). Is there a way to revert back to the older behavior, or is the new behavior considered the “correct” method?

    I’m trying to determine whether or not I need to refactor the pages on my site to work with the new setup or if that’s going to be wasted effort if it’s later reverted. Any insight would be greatly appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @rizbanr,

    I do some changes to improve the speed performance. Previously, I used array_search() function to find the ID of assigned custom URI and now isset() is used.

    You can fix it by using this code snippet:

    function pm_custom_uris_order($uris) {
    	krsort($uris);
    
    	return $uris;
    }
    add_filter('permalink_manager_uris', 'pm_custom_uris_order', 9999);

    Best regards,
    Maciej

    Thread Starter rizbanr

    (@rizbanr)

    I’ve tried adding the code, but I can’t seem to get it to do anything.

    Plugin Author Maciej Bis

    (@mbis)

    Where do you insert the code exactly? Could you send me the list of URIs displayed in “Tools -> Permalink Manager -> Debug” tab?

    Thread Starter rizbanr

    (@rizbanr)

    I’ve tried inserting it in the theme functions file and in permalink-manager.php.

    I’ll send the debug array to you by email, because my boss won’t want me posting it here publicly. I already have your email from a previous issue. This plugin has the best support of any I’ve used.

    Plugin Author Maciej Bis

    (@mbis)

    Could you try this code snippet instead?

    function pm_custom_uris_order() {
    	global $permalink_manager_uris;
    
    	krsort($permalink_manager_uris);
    }
    add_action('init', 'pm_custom_uris_order', 9999);
    Thread Starter rizbanr

    (@rizbanr)

    That does it! Thanks.

    Plugin Author Maciej Bis

    (@mbis)

    Perfect, I am glad that you managed to get it working 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Same URI page priority is now changed’ is closed to new replies.