Changeset 14075 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
- Timestamp:
- 09/24/2024 07:12:05 AM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r13673 r14075 752 752 * @return false|string The preview url. False if no preview is configured. 753 753 */ 754 public static function preview_link( $post = null ) {754 public static function preview_link( $post = null, $locale = null ) { 755 755 $post = get_post( $post ); 756 756 … … 762 762 $blueprint = $blueprints['blueprint.json']; 763 763 764 return sprintf( 'https://playground.wordpress.net/?plugin=%s&blueprint-url=%s', esc_attr($post->post_name), esc_attr($blueprint['url'] ) ); 764 $blueprint_url = $blueprint['url']; 765 $locale = $locale ?? get_locale(); 766 $blueprint_url = add_query_arg( 'lang', $locale, $blueprint_url ); 767 768 return sprintf( 'https://playground.wordpress.net/?plugin=%s&blueprint-url=%s', esc_attr($post->post_name), rawurlencode($blueprint_url) ); 765 769 } 766 770
Note: See TracChangeset
for help on using the changeset viewer.