Skip to content

Commit

Permalink
Added a link to the template parts page in wp_die() when the template…
Browse files Browse the repository at this point in the history
… part does not exist.
  • Loading branch information
mi5t4n committed Nov 25, 2024
1 parent 25ecd75 commit 39669ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/wp-admin/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@
$block_template = get_block_template( $_GET['postId'], 'wp_template_part' );

if ( null === $block_template ) {
wp_die( __( 'Invalid template part ID.' ) );
wp_die(
__( 'Invalid template part ID.' ),
'',
array(
'link_url' => add_query_arg( array( 'postType' => 'wp_template_part' ), admin_url( 'site-editor.php' ) ),
'link_text' => __( 'Return to template parts page' ),
)
);
}
break;
}
Expand Down

0 comments on commit 39669ab

Please sign in to comment.