Make WordPress Core

Ticket #32432: 32432-3.patch

File 32432-3.patch, 1015 bytes (added by juliobox, 11 years ago)
  • l10n.php

     
    877877                'translations' => array(),
    878878                'selected'     => '',
    879879                'show_available_translations' => true,
     880                'echo'         => true,
    880881        ) );
    881882
    882883        $translations = $args['translations'];
     
    910911                }
    911912        }
    912913
     914        $output = '';
     915
    913916        $translations_available = ( ! empty( $translations ) && $args['show_available_translations'] );
    914917
    915         printf( '<select name="%s" id="%s">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) );
     918        $output .= sprintf( '<select name="%s" id="%s">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) );
    916919
    917920        // Holds the HTML markup.
    918921        $structure = array();
     
    950953                $structure[] = '</optgroup>';
    951954        }
    952955
    953         echo join( "\n", $structure );
     956        $output .= join( "\n", $structure );
    954957
    955         echo '</select>';
     958        $output .= '</select>';
     959        if ( true === $args['echo'] ) {
     960                echo $output;
     961        } else {
     962                return $output;
     963        }
    956964}