Making WordPress.org


Ignore:
Timestamp:
02/23/2015 08:53:06 AM (10 years ago)
Author:
dd32
Message:

Translations API: Make haz have a iso 1 field to avoid a php notice in core.
See https://core.trac.wordpress.org/ticket/31319

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/translations/core/1.0/index.php

    r1042 r1294  
    2121call_headers( 'application/json' );
    2222
     23// Remove the following crud after 4.2 is released
     24// https://core.trac.wordpress.org/ticket/31319
     25if ( version_compare( $version, '4.2', '<' ) ) {
     26    foreach ( $translations as $t ) {
     27        if ( 'haz' == $t->language ) {
     28            $t->iso = (object)array( 1 => 'haz', 2 => 'haz' );
     29        }
     30    }
     31}
     32
    2333echo json_encode( array( 'translations' => $translations ) );
    2434
Note: See TracChangeset for help on using the changeset viewer.