PluginProbe
Polylang / 2.6.3
Polylang v2.6.3
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | frontend/frontend-links.php +3 -2 2.7.42.6.3 View file →
@@ -54,8 +54,9 @@
54 54 * @param int $queried_object_id Queried object id
55 55 */
56 56 if ( ! $url = apply_filters( 'pll_pre_translation_url', '', $language, $queried_object_id ) ) {
57 57 $qv = $wp_query->query_vars;
58 + $hide = $this->options['default_lang'] == $language->slug && $this->options['hide_default'];
58 59
59 60 // Post and attachment
60 61 if ( is_single() && ( $this->options['media_support'] || ! is_attachment() ) && ( $id = $this->model->post->get( $queried_object_id, $language ) ) && $this->model->post->current_user_can_read( $id ) ) {
61 62 $url = get_permalink( $id );
@@ -94,9 +95,9 @@
94 95 elseif ( ( is_category() || is_tag() || is_tax() ) && ( $term = get_queried_object() ) && $this->model->is_translated_taxonomy( $term->taxonomy ) ) {
95 96 $lang = $this->model->term->get_language( $term->term_id );
96 97
97 98 if ( ! $lang || $language->slug == $lang->slug ) {
98 - $url = get_term_link( $term, $term->taxonomy ); // Self link
99 + $url = wpcom_vip_get_term_link( $term, $term->taxonomy ); // Self link
99 100 }
100 101
101 102 elseif ( $tr_id = $this->model->term->get_translation( $term->term_id, $language ) ) {
102 103 if ( $tr_term = get_term( $tr_id, $term->taxonomy ) ) {
@@ -113,9 +114,9 @@
113 114 * @param string $lang The language code of the translation
114 115 * @param array $args Arguments used to evaluated the number of posts in the archive
115 116 */
116 117 if ( ! apply_filters( 'pll_hide_archive_translation_url', ! $count, $language->slug, array( 'taxonomy' => $term->taxonomy ) ) ) {
117 - $url = get_term_link( $tr_term, $term->taxonomy );
118 + $url = wpcom_vip_get_term_link( $tr_term, $term->taxonomy );
118 119 }
119 120 }
120 121 }
121 122 }