Make WordPress Core


Ignore:
Timestamp:
11/12/2021 03:53:18 AM (5 years ago)
Author:
noisysocks
Message:

Editor: Add Navigation Area infrastructure

Copies Navigation Area infrastrucutre from lib/navigation.php in Gutenberg. This
allows a Navigation block to be associated with a particular area which persists
when switching theme.

Props antonvlasenko, mamaduka, spacedmonkey.
See #54337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r52133 r52145  
    584584add_action( 'admin_footer-widgets.php', 'wp_add_iframed_editor_assets_html' );
    585585
     586add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );
     587add_action( 'edit_form_after_title', '_disable_content_editor_for_navigation_post_type' );
     588add_action( 'edit_form_after_editor', '_enable_content_editor_for_navigation_post_type' );
     589
     590/*
     591 * Disable "Post Attributes" for wp_navigation post type. The attributes are
     592 * also conditionally enabled when a site has custom templates. Block Theme
     593 * templates can be available for every post type.
     594 */
     595add_filter( 'theme_wp_navigation_templates', '__return_empty_array' );
     596
    586597// Taxonomy.
    587598add_action( 'init', 'create_initial_taxonomies', 0 ); // Highest priority.
    … …  
    671682
    672683// Navigation areas.
    673 add_action( 'setup_theme', '_register_default_navigation_areas' );
     684add_action( 'setup_theme', '_wp_register_default_navigation_areas' );
     685add_action( 'switch_theme', '_wp_migrate_menu_to_navigation_post', 99, 3 );
    674686
    675687unset( $filter, $action );
Note: See TracChangeset for help on using the changeset viewer.