Hi sillyme727
Could you please try to add the following code at the end of functions.php file of your theme or child?
if ( defined( 'YITH_WCWL' ) && ! function_exists( 'yith_wcwl_change_polylang_wishlist_url' ) ) {
function yith_wcwl_change_polylang_wishlist_url( $url, $action = 'view' ) {
$wishlist_page_id = yith_wcwl_object_id( get_option( 'yith_wcwl_wishlist_page_id' ) );
$base_url = get_the_permalink( $wishlist_page_id );
if ( defined( 'POLYLANG_VERSION' ) && pll_current_language() != pll_default_language() ) {
$translated_page = pll_get_post( $wishlist_page_id );
if ( $translated_page ) {
$base_url = get_the_permalink( $translated_page );
}
}
$action_params = explode( '/', $action );
$params = array();
if ( isset( $action_params[1] ) ) {
$action = $action_params[0];
$params['wishlist-action'] = $action;
if ( $action == 'view' ) {
$params['wishlist_id'] = $action_params[1];
} elseif ( $action == 'user' ) {
$params['user_id'] = $action_params[1];
}
} else {
$params['wishlist-action'] = $action;
}
$base_url = add_query_arg( $params, $base_url );
return esc_url_raw( $base_url );
}
add_filter( 'yith_wcwl_wishlist_page_url', 'yith_wcwl_change_polylang_wishlist_url', 10, 2 );
}
This is a little wishlist – polylang integration I developed, that should force plugin using “query string” version of the url (?action=view&wishlist_id=SOMETHING)
Please, let me know if this works as expected
Have a nice day
Hi! Thank you so much for your response.
I added the code to my functions.php and I got an error code and I could not access my dashboard anymore. The error code was as follows: Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) (in my functions.php in line 45)
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Side note to @vasilelazar Per the forum welcome please post your own topic.
Taking over someone else’s old topic doesn’t help them and you’ll get better support if you start your own topic.