Ticket #32432: 32432.4.patch
| File 32432.4.patch, 1.5 KB (added by , 11 years ago) |
|---|
-
l10n.php
866 866 * {@see wp_get_available_translations()}. 867 867 * @type string $selected Language which should be selected. Default empty. 868 868 * @type bool $show_available_translations Whether to show available translations. Default true. 869 * @type bool $echo True to output the markup (default), or false to return it. 869 870 * } 870 871 */ 871 872 function wp_dropdown_languages( $args = array() ) { … … 877 878 'translations' => array(), 878 879 'selected' => '', 879 880 'show_available_translations' => true, 881 'echo' => true, 880 882 ) ); 881 883 882 884 $translations = $args['translations']; … … 910 912 } 911 913 } 912 914 915 $output = ''; 916 913 917 $translations_available = ( ! empty( $translations ) && $args['show_available_translations'] ); 914 918 915 printf( '<select name="%s" id="%s">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) );919 $output .= sprintf( '<select name="%s" id="%s">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) ); 916 920 917 921 // Holds the HTML markup. 918 922 $structure = array(); … … 950 954 $structure[] = '</optgroup>'; 951 955 } 952 956 953 echojoin( "\n", $structure );957 $output .= join( "\n", $structure ); 954 958 955 echo '</select>'; 959 $output .= '</select>'; 960 if ( $args['echo'] ) { 961 echo $output; 962 } else { 963 return $output; 964 } 956 965 }