Changeset 12931
- Timestamp:
- 10/05/2023 05:47:17 AM (18 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r12826 r12931 720 720 return sprintf( 'https://downloads.wordpress.org/plugin/%s.zip', $post->post_name ); 721 721 } 722 } 723 724 /** 725 * Generate a live preview (playground) link for a given plugin. 726 * 727 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. 728 * @param string $landing_page The landing page for the preview. Option. Default: /wp-admin/plugins.php. 729 * @return string The preview url. 730 */ 731 public static function preview_link( $post = null, $landing_page = '/wp-admin/plugins.php' ) { 732 $post = get_post( $post ); 733 734 return sprintf( 'https://playground.wordpress.net/?plugin=%s&login=1&url=%s', esc_attr( $post->post_name ), esc_attr( $landing_page ) ); 722 735 } 723 736 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
r12492 r12931 41 41 <?php if ( 'publish' === get_post_status() || current_user_can( 'plugin_admin_view', $post ) ) : ?> 42 42 <a class="plugin-download button download-button button-large" href="<?php echo esc_url( Template::download_link() ); ?>"><?php esc_html_e( 'Download', 'wporg-plugins' ); ?></a> 43 <?php if ( !Template::is_plugin_outdated( $post ) ) : ?> 44 <a class="plugin-download button download-button button-large" href="<?php echo esc_url( Template::preview_link() ); ?>"><?php esc_html_e( 'Live Preview', 'wporg-plugins' ); ?></a> 45 <?php endif; ?> 43 46 <?php endif; ?> 44 47 </div>
Note: See TracChangeset
for help on using the changeset viewer.