Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_POST['action'] ) && 'menu-quick-search' == $_POST['action'] ) {
add_filter( 'wp_setup_nav_menu_item', 'sp_wp_setup_nav_menu_item' );
function sp_wp_setup_nav_menu_item( $menu_item ) {
if ( isset( $menu_item->post_title ) ) {
$menu_item->post_title = $menu_item->post_title . ' (' . pll_get_post_language( $menu_item->ID ) . ')';
}
return $menu_item;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment