Changeset 55743
- Timestamp:
- 05/10/2023 05:34:13 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r55703 r55743 1436 1436 * 1437 1437 * Can be used within the WordPress loop or outside of it. Can be used with 1438 * pages, posts, attachments, and revisions.1438 * pages, posts, attachments, revisions, global styles, templates, and template parts. 1439 1439 * 1440 1440 * @since 2.3.0 … … 1470 1470 } 1471 1471 1472 if ( $post_type_object->_edit_link ) { 1472 $link = ''; 1473 1474 if ( 'wp_template' === $post->post_type || 'wp_template_part' === $post->post_type ) { 1475 $slug = urlencode( get_stylesheet() . '//' . $post->post_name ); 1476 $link = admin_url( sprintf( $post_type_object->_edit_link, $post->post_type, $slug ) ); 1477 } elseif ( $post_type_object->_edit_link ) { 1473 1478 $link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) ); 1474 } else {1475 $link = '';1476 1479 } 1477 1480 -
trunk/src/wp-includes/post.php
r55732 r55743 333 333 ); 334 334 335 $template_edit_link = 'site-editor.php?' . build_query( 336 array( 337 'postType' => '%s', 338 'postId' => '%s', 339 'canvas' => 'edit', 340 ) 341 ); 342 335 343 register_post_type( 336 344 'wp_template', … … 359 367 'public' => false, 360 368 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 369 '_edit_link' => $template_edit_link, /* internal use only. don't use this when registering your own post type. */ 361 370 'has_archive' => false, 362 371 'show_ui' => false, … … 419 428 'public' => false, 420 429 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 430 '_edit_link' => $template_edit_link, /* internal use only. don't use this when registering your own post type. */ 421 431 'has_archive' => false, 422 432 'show_ui' => false, … … 459 469 'public' => false, 460 470 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 471 '_edit_link' => '/site-editor.php?canvas=edit', /* internal use only. don't use this when registering your own post type. */ 461 472 'show_ui' => false, 462 473 'show_in_rest' => false,
Note: See TracChangeset
for help on using the changeset viewer.