Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GlotPress warnings (on local installs) #319

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public function jetpack_stats() {
* and script loader.
*/
public function show_admin_bar() {
add_action( 'gp_head', 'wp_admin_bar_header' );
add_action( 'gp_head', 'wp_enqueue_admin_bar_header_styles' );
add_action( 'gp_head', '_admin_bar_bump_cb' );

gp_enqueue_script( 'admin-bar' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
<nav id="site-navigation" class="navigation-main clear" role="navigation">
<button type="button" class="menu-toggle dashicons dashicons-arrow-down-alt2"></button>
<?php
wp_nav_menu( [
'theme_location' => 'wporg_header_subsite_nav',
'fallback_cb' => false,
] );
wp_nav_menu(
array(
'theme_location' => 'wporg_header_subsite_nav',
'fallback_cb' => false,
)
);
?>
</nav>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ class Index extends GP_Route {
public function get_locales() {
$existing_locales = Plugin::get_existing_locales();

$locales = array();
foreach ( $existing_locales as $locale ) {
$locales[] = GP_Locales::by_slug( $locale );
}
$locales = array_filter( array_map( array( 'GP_Locales', 'by_slug' ), Plugin::get_existing_locales() ) );
usort( $locales, array( $this, '_sort_english_name_callback' ) );
unset( $existing_locales );

Expand All @@ -33,6 +30,6 @@ public function get_locales() {
}

private function _sort_english_name_callback( $a, $b ) {
return $a->english_name > $b->english_name;
return $a->english_name <=> $b->english_name;
}
}