Making WordPress.org


Ignore:
Timestamp:
12/18/2023 04:27:44 AM (6 months ago)
Author:
dufresnesteven
Message:

Playground: Redirect developer.wp.org/playground to GitHub documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php

    r13050 r13064  
    5757                // Data Liberation
    5858                '/and' => '/data-liberation/',
    59 
    60                 // Playground, temporarily.
    61                 '/playground' => [ 302, 'https://developer.wordpress.org/playground/' ]
    6259            ];
    6360
     
    290287    exit;
    291288} );
     289
     290/**
     291 * Redirect developer.wp.org/playground/ to github documentation.
     292 */
     293add_action( 'template_redirect', function() {
     294    $path = strtolower( $_SERVER['REQUEST_URI'] ?? '/' );
     295    if ( 'developer.wordpress.org' !== $_SERVER['HTTP_HOST'] || ! str_starts_with( $path, '/playground' ) ) {
     296        return;
     297    }
     298
     299    wp_redirect( 'https://wordpress.github.io/wordpress-playground/', 301 );
     300    exit;
     301} );
     302
Note: See TracChangeset for help on using the changeset viewer.