I have this filter in my store:
domain_dot_com/tienda/?elegidos=si
("/tienda/" is spanish for regular default woocommerce "/shop/" )
No matter what i try, i can’t turn that into a permalink like: domain_dot_com/nuestros-productos-elegidos/
wich, of course, would run /tienda/?elegidos=si under the hood
I’ve tryed every redirect tutorial out there, maybe i’m too dumb for this
Note:
I did manage to turn:
domain_dot_com/?s=searchTerms
into
domain_dot_com/search/searchTerms
using this:
// primero hay que crear la redireccion del template
function cambiar_search_url()
{
if (is_search() && !empty($_GET['s'])) {
//wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
wp_redirect(home_url("/busqueda/", 'https') . urlencode(get_query_var('s')));
exit();
}
}
add_action('template_redirect', 'cambiar_search_url');
// y despues la redireccion de la url
function reescribir_search_slug()
{
add_rewrite_rule(
'busqueda(/([^/]+))?(/([^/]+))?(/([^/]+))?/?',
'index.php?s=$matches[2]&paged=$matches[6]',
'top'
);
}
add_action('init', 'reescribir_search_slug');
But i can’t do it with custom filters

