Changeset 6340
- Timestamp:
- 01/10/2018 07:00:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php
r6287 r6340 86 86 // English directory. 87 87 if ( 'en_US' === $current_locale ) { 88 $current_site = get_site(); 88 $current_path = get_site()->path; 89 $referring_path = wp_parse_url( $request->get_header( 'referer' ), PHP_URL_PATH ); 90 91 if ( $referring_path && '/' === $referring_path[0] ) { 92 $current_path = $referring_path; 93 } 89 94 90 95 // Only one locale suggestion. … … 97 102 $this->translate( 'This plugin is also available in %1$s. <a href="%2$s">Help improve the translation!</a>', $locale ), 98 103 sprintf( 99 '<a href="https://%s.wordpress.org%s %s/">%s</a>',104 '<a href="https://%s.wordpress.org%s">%s</a>', 100 105 $locale_subdomain_assoc[ $locale ]->subdomain, 101 $current_site->path, 102 $plugin_slug, 106 esc_url( $current_path ), 103 107 $language 104 108 ), … … 111 115 '<a href="https://%s.wordpress.org%s">%s</a>', 112 116 $locale_subdomain_assoc[ $locale ]->subdomain, 113 $current_site->path,117 esc_url( $current_path ), 114 118 $language 115 119 ) … … 127 131 foreach ( $suggest_named_locales as $locale => $language ) { 128 132 $other_suggest .= sprintf( 129 '<a href="https://%s.wordpress.org%s %s/">%s</a>, ',133 '<a href="https://%s.wordpress.org%s/">%s</a>, ', 130 134 $locale_subdomain_assoc[ $locale ]->subdomain, 131 $current_site->path, 132 $plugin_slug, 135 esc_url( $current_path ), 133 136 $language 134 137 ); … … 138 141 $this->translate( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s">Help improve the translation!</a>', $primary_locale ), 139 142 sprintf( 140 '<a href="https://%s.wordpress.org%s %s/">%s</a>',143 '<a href="https://%s.wordpress.org%s">%s</a>', 141 144 $locale_subdomain_assoc[ $primary_locale ]->subdomain, 142 $current_site->path, 143 $plugin_slug, 145 esc_url( $current_path ), 144 146 $primary_language 145 147 ), … … 153 155 '<a href="https://%s.wordpress.org%s">%s</a>, ', 154 156 $locale_subdomain_assoc[ $locale ]->subdomain, 155 $current_site->path,157 esc_url( $current_path ), 156 158 $language 157 159 ); … … 163 165 '<a href="https://%s.wordpress.org%s">%s</a>', 164 166 $locale_subdomain_assoc[ $primary_locale ]->subdomain, 165 $current_site->path,167 esc_url( $current_path ), 166 168 $primary_language 167 169 ),
Note: See TracChangeset
for help on using the changeset viewer.