wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_wp_reset_invalid_menu_item_parent is private and should not be used in themes or plugins directly.
_wp_reset_invalid_menu_item_parent › WordPress Function
Seit6.2.0
Veraltetn/v
› _wp_reset_invalid_menu_item_parent ( $menu_item_data )
Zugriff: |
|
Parameter: |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Prevents menu items from being their own parent.
Resets menu_item_parent to 0 when the parent is set to the item itself. For use before saving_menu_item_menu_item_parent
in nav-menus.php.Ähnliche Funktionen: wp_setup_nav_menu_item, _wp_delete_tax_menu_item, wp_get_nav_menu_items, _wp_delete_post_menu_item, _is_valid_nav_menu_item
Quellcode
function _wp_reset_invalid_menu_item_parent( $menu_item_data ) { if ( ! is_array( $menu_item_data ) ) { return $menu_item_data; } if ( ! empty( $menu_item_data['ID'] ) && ! empty( $menu_item_data['menu_item_parent'] ) && (int) $menu_item_data['ID'] === (int) $menu_item_data['menu_item_parent'] ) { $menu_item_data['menu_item_parent'] = 0; } return $menu_item_data; }