D
D
denism3002020-03-23 16:30:28
C++ / C#
denism300, 2020-03-23 16:30:28

How to add your endpoint to breadcrumbs?

Registered my endpoint:

function add_wish_list_endpoint()
{
  add_rewrite_endpoint('wish-list', EP_ROOT | EP_PAGES);
}
add_action('init', 'add_wish_list_endpoint');

function wish_list_query_vars($vars)
{
  $vars[] = 'wish-list';
  return $vars;
}
add_filter('query_vars', 'wish_list_query_vars', 0);

function show_wish_list()
{
  echo do_shortcode('[woosw_list]');
}
add_action('woocommerce_account_wish-list_endpoint', 'show_wish_list');

function renew_my_account_links($menu_links)
{
  $menu_links['wish-list']          = __('Мои желания');

  return $menu_links;
}
add_filter('woocommerce_account_menu_items', 'renew_my_account_links');


However, when I'm on this page, it's not in the breadcrumbs and the is_wc_endpoint_url() check on that page doesn't work either.
How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2019-08-28
@AleksandrB

And why should? This is C, not C++, not Perl, where the wildest constructs exist. Everything here is as simple as a piece of wood :)

char domen[100];
char stroka = "В чащах юга жил бы цитрус";

strcpy(domen, stroka);

The sizeof operator returns the length of a type . It will return 1 to you, because the length of the char type is 1 byte :)
If you want to form one long string, then the index can be calculated, but if something like domain[N] is on the left, then only a literal can be on the right. To write a string to an array from a specific position, you need to use the same strcpy ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question