Making WordPress.org


Ignore:
Timestamp:
12/04/2023 04:42:52 AM (2 years ago)
Author:
tellyworth
Message:

Plugins: improved Test Preview button

This uses the new Playground blueprint-url param to pass the blueprint rather than a URL fragment.

Also, opens the preview in a new tab, as per suggestions.

See #7251.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php

    r12978 r12999  
    758758        }
    759759
    760         $blueprint_encoded = esc_html( str_replace( '%', '%25', $blueprint['contents'] ) );
    761 
    762         return sprintf( 'https://playground.wordpress.net/?plugin=%s#%s', $post->post_name, $blueprint_encoded );
     760        $blueprint_url = sprintf( 'https://wordpress.org/plugins/wp-json/plugins/v1/plugin/%s/blueprint.json?rev=%d', $post->post_name, $blueprint['revision'] );
     761
     762        return sprintf( 'https://playground.wordpress.net/?plugin=%s&blueprint-url=%s', esc_attr($post->post_name), esc_attr($blueprint_url ) );
    763763    }
    764764
Note: See TracChangeset for help on using the changeset viewer.