Y
Y
Yuri Kirillov2017-03-29 19:46:19
User navigation
Yuri Kirillov, 2017-03-29 19:46:19

Building a menu based on WordPress custom fields?

There is a manually created taxonometry

function add_new_taxonomies() {	
register_taxonomy('депо',
    array('post'),
    array(
      'labels' => array(
        'name'              => 'Депо',
        'singular_name'     => 'Депо',
        'search_items'      => 'Искать депо',
        'all_items'         => 'Все депо',
        'parent_item'       => 'Выбрать ж/д',
        'parent_item_colon' => 'Главное депо:',
        'edit_item'         => 'Редактировать депо',
        'update_item'       => 'Обновить депо',
        'add_new_item'      => 'Добавить новое депо',
        'new_item_name'     => 'Название нового депо',
        'menu_name'         => 'Депо',
      ),
      'hierarchical'          => true,
      'show_ui'               => true,
      'show_admin_column'     => true,
      'update_count_callback' => '_update_post_term_count',
      'query_var'             => true,
      'rewrite' => array(
        'slug' => 'депо', // ярлык
        'hierarchical' => true // разрешить вложенность
      ),
    )
  );
add_action( 'init', 'add_new_taxonomies', 0 );

Works properly. Then I decided to make a Menu based on this, and here is such a nuance ...
e8be66fff2464804b8df9e22e3f904f0.png
Can anyone meet this kind of error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Pushkarev, 2017-03-29
@AXP-dev

I got such an error only in one case - when deleting the material. At the same time, the link remained in the menu. As far as I remember, this was recently added

M
Mr Crabbz, 2017-03-29
@Punkie

Try changing the Cyrillic slug to Latin:

'rewrite' => array(
        'slug' => 'депо', // ярлык

on the
'rewrite' => array(
        'slug' => 'depo', // ярлык

Just don't forget to re-save the permalinks later (Settings - Permalinks - Save).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question