L
L
leviathan2017-08-21 18:50:27
WooCommerce
leviathan, 2017-08-21 18:50:27

Woocommerce menu priorities in dashboard?

The script adds a new menu to the LC, but it appears at the very end (after "Exit").
How to change location?

/* Add custom links to WC My account menu */
function iconic_account_menu_items( $items ) {

  $items['help'] = __( 'Помощь', 'iconic' );
  return $items;

}
add_filter( 'woocommerce_account_menu_items', 'iconic_account_menu_items', 10, 1 );

For example -> https://iconicwp.com/add-custom-page-account-area-...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Axian Ltd., 2017-08-21
@AxianLTD

I would re-create items by inserting my element where needed and returning a new array.

W
WordPress WooCommerce, 2017-08-21
@maxxannik

Saw array sorting methods php.net/manual/ru/array.sorting.php
Your method sticks an element at the end of the array. And so it outputs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question