Making WordPress.org


Ignore:
Timestamp:
04/26/2023 07:31:59 AM (2 years ago)
Author:
dd32
Message:

API: Themes Info endpoint: Support "flat" requets for /themes/info/1.2/ as we do for plugins.

This allows for easer to read URLs as we can use ?slug=... rather than ?request[slug]=....

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/themes/info/1.2/index.php

    r8914 r12561  
    1414}
    1515
     16// Support "flat" requests, ie. no '?request[slug]=..` needed, just '?slug=...'
     17if ( ! isset( $_GET['request'] ) ) {
     18    $_GET = $_REQUEST = array(
     19        'action'  => $_GET['action'] ?? '', // 1.2 only supports GET requests
     20        'request' => array_diff_key( $_GET, [ 'action' => false, 'callback' => false ] ),
     21    );
     22}
     23
    1624require dirname( __DIR__ ) . '/1.1/index.php';
Note: See TracChangeset for help on using the changeset viewer.