Hi,
I've never posted a 'suggestion' for Wordpress before. I've worked in Drupal and the system of bugs/suggestions is different. So if someone can suggest a better way to start this conversation, I'm all ears.
I would like to be able to add a filter to redirect_guess_404_permalink() so that it can be replaced or the sql query it generates be controlled.
I frequently have sites with multiple taxonomies where various posts will have the same slug. When visitors type in just the slug (without the full path ie. /taxonomy-prefix/slug) they expect to be directed to the most popular post_type.
But this function allows for no control over the ORDER of the returned posts. So if you have 5 posts all with the same slug, basically you have no control over which 'guess' will be returned.
There should be a way to modify this function so that it prioritises certain post_types. This could be done either by adding a filter to canonical.php to allow for replacing this function or by adding a filter inside redirect_guess_404_permalink() so that one can alter the SQL statement in the query.
How do I submit a proposed change such as this for review?
TIA.