Title: Menu Item Types
Author: maxpertici
Published: <strong>7 oktobris, 2021</strong>
Last modified: 2 oktobris, 2025

---

Meklēt spraudņus

![](https://ps.w.org/menu-item-types/assets/banner-772x250.jpg?rev=2646986)

![](https://ps.w.org/menu-item-types/assets/icon-256x256.jpg?rev=2646971)

# Menu Item Types

 Autors [maxpertici](https://profiles.wordpress.org/maxpertici/)

[Lejupielādēt](https://downloads.wordpress.org/plugin/menu-item-types.1.7.zip)

 * [Sīkāka informācija](https://lv.wordpress.org/plugins/menu-item-types/#description)
 * [Atsauksmes](https://lv.wordpress.org/plugins/menu-item-types/#reviews)
 *  [Uzstādīšana](https://lv.wordpress.org/plugins/menu-item-types/#installation)
 * [Attīstība](https://lv.wordpress.org/plugins/menu-item-types/#developers)

 [Atbalsts](https://wordpress.org/support/plugin/menu-item-types/)

## Apraksts

Menu Item Types makes it easy to add links to your archive pages, titles, items 
without URL, paragraphs or images to your navigation menus.
 You can also easily
override the templates and/or create your own custom elements.

### Create your own item type

You need to declare your new type in, functions.php, a plugin, child theme, or your
custom theme like this :

    ```
    function register_my_custom_type(){

        $args = array(
            'slug'        => "my-custom-type",
            'label'       => __( 'My Custom Type', 'my-custom-type' ),
            'render'      => 'path/to/render/my-custom-render.php',
        );

        mitypes_register_type( $args );
    }
    add_action( 'mitypes_init', 'register_my_custom_type' );
    ```

You can do more than that on $args.

    ```
    $args = array(
        'slug'   => "my-custom-type",
        'label'  => __( 'My Custom Type', 'my-custom-type' ),
        'render' => 'path/to/my-custom-type-render.php',

        // Link your custom icon
        'icon' => 'https://url-to-icon-file.svg',

        // Return ACF Group field array
        'field-group' => [
            'key'   => 'uniq_key',
            'title' => 'Group Title',
            'fields => [
                ...
            ],
            'location' => [
                [
                    [
                        'param' => 'mitypes',
                        'operator' => '==',
                        'value' => 'my-custom-type',
                    ],
                ],
            ],

        ],

        // Use callback for customize your item
        // you can add filter on 'mitypes_nav_menu_link_attributes' if you need
        'callback' => function(){ ... }
    );
    ```

And finally, you can work in the render with some variables.
 You have two variables
available:

    ```
    // $item is the WP_Post of the menu item, with which you can, for example, retrieve custom field data.

    $id = get_field( 'acf-slug', $item->ID ) ;


    // $args is an object containing the complete configuration of the wp_nav_menu() call,
    // including the current menu (WP_Term), classes, IDs, wrappers, depth, walker, menu location, etc.
    // More info : https://developer.wordpress.org/reference/functions/wp_nav_menu/
    ```

There are already additional plugins.
 You can also create your own elements like
these plugins do:

 * [Menu Item Types — Button](https://wordpress.org/plugins/menu-item-types-button/)
 * [Menu Item Types — Action](https://wordpress.org/plugins/menu-item-types-action/)

### Customize the plugin

    ```
    // Disable Post Type Archive Metabox
    add_filter( 'mitypes_has_post_type_archive_metabox', '__return_false' ) ;

    // Disable Buildin Item types
    add_filter( 'mitypes_has_buildin_item_types', '__return_false' ) ;

    // Mix Buildin and Plugin Item types in the metabox
    add_filter( 'mitypes_mix_metabox_item_types', '__return_true' ) ;

    // Filter Supported Item types
    add_filter( 'mitypes_supported_types', function(){ return ['image']; } );

    // Disable Nav Item Icons
    add_filter( 'mitypes_nav_menu_items_has_icons', '__return_false' ) ;
    ```

## Uzstādīšana

 1. Install the plugin and activate.
 2. Go to Apparence > Menu
 3. If the new metaboxes are not visible, use screen options

## BUJ

### My elements haven’t styles

Menu Item Types does not provide graphic formatting. It provides the tools to create
your own elements.

### Is ACF essential?

[Yes. Download and install it.](https://wordpress.org/plugins/advanced-custom-fields/)

### How to add my own custom fields?

Menu Item Types adds a new ACF location to target different types of menu items.

## Atsauksmes

![](https://secure.gravatar.com/avatar/951d6ae2c43e7e31e5127f5ae539e81e569598404f71dcecb6347d89dad388bd?
s=60&d=retro&r=g)

### 󠀁[Great plugin](https://wordpress.org/support/topic/great-plugin-41243/)󠁿

 [umbertone](https://profiles.wordpress.org/spolyakov/) 30 janvāris, 2026 1 atbilde

Many thanks! Hope WP Core will have some API to do it natively some day 🙂

![](https://secure.gravatar.com/avatar/3ae75e553e2b1d10313fba2218ddceee567a8470c97f7f6b3b43c3aad6015a7c?
s=60&d=retro&r=g)

### 󠀁[Very helpful for e.g. CPTs](https://wordpress.org/support/topic/very-helpful-for-e-g-cpts/)󠁿

 [eickit](https://profiles.wordpress.org/eickit/) 17 janvāris, 2025 1 atbilde

Very helpful plugin if you want to add CPTs to the menu. Why is something like this
not in the Wordpress standard?

 [ Lasīt 2 atsauksmes ](https://wordpress.org/support/plugin/menu-item-types/reviews/)

## Autori un izstrādātāji

“Menu Item Types” ir atvērtā pirmkoda programmatūra. Šo spraudni ir veidojuši šādi
cilvēki.

Līdzdalībnieki

 *   [ Maxime Pertici ](https://profiles.wordpress.org/maxpertici/)

“Menu Item Types” ir tulkots lokalizācijā 1. Paldies [tulkotājiem](https://translate.wordpress.org/projects/wp-plugins/menu-item-types/contributors)
par ieguldījumu.

[Tulkot “Menu Item Types&#8221 savā valodā.](https://translate.wordpress.org/projects/wp-plugins/menu-item-types)

### Vai jūs interesē attīstība?

[Pārlūkojiet kodu](https://plugins.trac.wordpress.org/browser/menu-item-types/),
apmeklējiet[ SVN krātuvi ](https://plugins.svn.wordpress.org/menu-item-types/)vai
abonējiet[ attīstības žurnālu](https://plugins.trac.wordpress.org/log/menu-item-types/),
ko izveidojis [RSS](https://plugins.trac.wordpress.org/log/menu-item-types/?limit=100&mode=stop_on_copy&format=rss).

## Izmaiņu žurnāls

#### 1.7

 * Fix : mitypes_init hook timing
 * Fix : buildin paragraph slug (maybe if you excluded it with the error, it will
   be back in your admin, sorry)
 * Fix : image size in Image type
 * Update readme.txt with more code information (thanks to Shoulders for his help)
 * PHP 8.x required

#### 1.6

 * Fix : translation’s notices
 * Add : user’s locale support

#### 1.5

 * Add : 2 hooks mitypes_init & mitypes_setup
 * Add : mitypes_register_type() function
 * Add : callback in type definition for exec actions or attach hooks ater loading
   the type
 * Fix : field-group loading logic
 * Fix : image type render

#### 1.4

 * Add filter : mitypes_nav_menu_items_has_icons

#### 1.3

 * Fix : fix ACF location match. now you can create a location test with the menu
   item type name & another native item type.

#### 1.2

 * Add filter : mitypes_has_post_type_archive_metabox
 * Add filter : mitypes_has_buildin_item_types
 * Add filter : mitypes_mix_metabox_item_types
 * Add filter : mitypes_supported_types
 * Add filter : mitypes_has_{$type}_item_type_support
 * Add render callback option : thx [ogorzalka PR](https://github.com/maxpertici/menu-item-types/pull/2)
 * Improve svg support : thx [ogorzalka PR](https://github.com/maxpertici/menu-item-types/pull/2)
 * Improve ACF’s test : thx [alexwoollam PR](https://github.com/maxpertici/menu-item-types/pull/1)

#### 1.1

 * Improved support for custom elements with the ability to register an icon.
 * FIX post_type_archive label

#### 1.0

 * Launch

## Meta

 *  Versija **1.7**
 *  Pēdējo reizi atjaunots: **pirms 8 mēnešiem**
 *  Aktīvās instalācijas: **100+**
 *  WordPress versija ** 5.8 vai jaunāka **
 *  Pārbaudīts līdz: **6.9.4**
 *  PHP versija ** 8.0 vai jaunāka **
 *  Valodas
 * [English (US)](https://wordpress.org/plugins/menu-item-types/) un [French (France)](https://fr.wordpress.org/plugins/menu-item-types/).
 *  [Tulkojiet savā valodā](https://translate.wordpress.org/projects/wp-plugins/menu-item-types)
 * Birkas:
 * [custom](https://lv.wordpress.org/plugins/tags/custom/)[menu](https://lv.wordpress.org/plugins/tags/menu/)
   [Nav item](https://lv.wordpress.org/plugins/tags/nav-item/)
 *  [Papildu skats](https://lv.wordpress.org/plugins/menu-item-types/advanced/)

## Vērtējumi

 5 no 5 zvaigznēm.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/menu-item-types/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/menu-item-types/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/menu-item-types/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/menu-item-types/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/menu-item-types/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/menu-item-types/reviews/#new-post)

[Skatīt visas atsauksmes](https://wordpress.org/support/plugin/menu-item-types/reviews/)

## Līdzdalībnieki

 *   [ Maxime Pertici ](https://profiles.wordpress.org/maxpertici/)

## Atbalsts

Jums ir kaut kas ko teikt? Vajadzīga palīdzība?

 [Skatīt atbalsta forumu](https://wordpress.org/support/plugin/menu-item-types/)