Make WordPress Core


Ignore:
Timestamp:
06/27/2023 06:00:59 AM (10 months ago)
Author:
isabel_brison
Message:

Editor: fix post edit navigation link.

Adds a custom link for navigation post types.

Props get_dave, spacedmonkey, ramonopoly.
Fixes #58589.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r56021 r56053  
    14391439 *
    14401440 * @since 2.3.0
     1441 * @since 6.3.0 Adds custom link for wp_navigation post types.
     1442 *              Adds custom links for wp_template_part and wp_template post types.
    14411443 *
    14421444 * @param int|WP_Post $post    Optional. Post ID or post object. Default is the global `$post`.
     
    14751477        $slug = urlencode( get_stylesheet() . '//' . $post->post_name );
    14761478        $link = admin_url( sprintf( $post_type_object->_edit_link, $post->post_type, $slug ) );
     1479    } elseif ( 'wp_navigation' === $post->post_type ) {
     1480        $link = admin_url( sprintf( $post_type_object->_edit_link, (string) $post->ID ) );
    14771481    } elseif ( $post_type_object->_edit_link ) {
    14781482        $link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
Note: See TracChangeset for help on using the changeset viewer.