We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using Polylang plugin and no matter the language, always return the same page.
I don't know how the other multi-language plugin work, but for polylang you can change the function to this:
public function custom_404_pro_redirect() { global $wpdb; if (is_404()) { $sql = 'SELECT * FROM ' . $wpdb->prefix . $this->helpers->table_options; $sql_result = $wpdb->get_results($sql); $row_mode = $sql_result[0]; $row_mode_page = $sql_result[1]; $row_mode_url = $sql_result[2]; $row_send_email = $sql_result[3]; $row_logging_enabled = $sql_result[4]; $row_redirect_error_code = $sql_result[5]; if ($row_logging_enabled->value) { self::custom_404_pro_log($row_send_email->value); } if ($row_mode->value === "page") { $page = get_post($row_mode_page->value); //Polylang if (function_exists("pll_get_post")) { $translated_page_id = pll_get_post($row_mode_page->value, pll_current_language()); $page = get_post($translated_page_id); } wp_redirect($page->guid, $row_redirect_error_code->value); } elseif ($row_mode->value === 'url') { wp_redirect($row_mode_url->value, $row_redirect_error_code->value); } } }
The text was updated successfully, but these errors were encountered:
@JoaoFreitas2002 - thanks for this! I'll take a look and see what can be done.
Sorry, something went wrong.
No branches or pull requests
I am using Polylang plugin and no matter the language, always return the same page.
I don't know how the other multi-language plugin work, but for polylang you can change the function to this:
The text was updated successfully, but these errors were encountered: