WordPress.org

Making WordPress.org


Ignore:
Timestamp:
06/22/2016 03:21:57 PM (6 years ago)
Author:
ocean90
Message:

Plugin Directory: Change the API endpoint for locale banners to /locale-banner so it can be used for other requests.

See #1728.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php

    r3554 r3556  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory\API\Routes;
     3use WordPressdotorg\Plugin_Directory\API\Base;
    34use WP_REST_Server;
    45
     
    89 * @package WordPressdotorg_Plugin_Directory
    910 */
    10 class Plugin_Translations extends Plugin {
     11class Locale_Banner extends Base {
    1112
    1213    function __construct() {
    13         register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/translations/?', array(
    14             'methods'  => WP_REST_Server::READABLE,
    15             'callback' => array( $this, 'translations' ),
     14        register_rest_route( 'plugins/v1', '/locale-banner', array(
     15            'methods'  => WP_REST_Server::EDITABLE,
     16            'callback' => array( $this, 'locale_banner' ),
    1617            'args' => array(
    1718                'plugin_slug' => array(
     
    2829     * @return array A formatted array of all the data for the plugin.
    2930     */
    30     function translations( $request ) {
     31    function locale_banner( $request ) {
    3132        global $wpdb;
    3233
Note: See TracChangeset for help on using the changeset viewer.