Changeset 9838
- Timestamp:
- 05/09/2020 04:05:35 PM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/admin/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/admin/network/class-locale-associations-view.php
r8430 r9838 119 119 <p> 120 120 <label for="locale"><?php _e( 'Locale:', 'rosetta' ); ?></label> 121 <input type="text" id="locale" name="locale" class="code" /> 121 <select id="locale" name="locale" required> 122 <option value=""><?php _e( '— Select —', 'rosetta' ); ?></option> 123 <?php 124 foreach ( $this->page->get_available_wp_locales() as $locale ) { 125 printf( 126 '<option value="%s">%s</option>', 127 esc_attr( $locale ), 128 esc_html( $locale ) 129 ); 130 } 131 ?> 132 </select> 122 133 123 134 <label for="subdomain"><?php _e( 'Subdomain:', 'rosetta' ); ?></label> 124 <input type="text" id="subdomain" name="subdomain" class="code" />135 <input type="text" id="subdomain" name="subdomain" class="code" required /> 125 136 </p> 126 137 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/admin/network/class-locale-associations.php
r8430 r9838 3 3 namespace WordPressdotorg\Rosetta\Admin\Network; 4 4 5 use GP_Locales; 5 6 use WordPressdotorg\Rosetta\Admin\Admin_Page; 6 7 use WordPressdotorg\Rosetta\Admin\Admin_Page_View; … … 224 225 225 226 /** 227 * Retrieves all available WP locales which are not assigned to a site yet. 228 * 229 * @return array List of locales. 230 */ 231 public function get_available_wp_locales() { 232 global $wpdb; 233 234 $locales = GP_Locales::locales(); 235 $wp_locales = array_filter( wp_list_pluck( $locales, 'wp_locale' ) ); 236 $wp_locales_in_use = $wpdb->get_col( 'SELECT locale FROM ' . Tables::LOCALES ); 237 238 $wp_locales_in_use[] = 'en_US'; 239 240 return array_diff( $wp_locales, $wp_locales_in_use ); 241 } 242 243 /** 226 244 * Gets the admin URL of the page. 227 245 *
Note: See TracChangeset
for help on using the changeset viewer.