Skip to content

Commit

Permalink
WordPress will try to create a slug from the title. WordPress will al…
Browse files Browse the repository at this point in the history
…so look for a corresponding page- template that matches the slug name. Therefore if a page template exists with the name page-no-title, WordPress will apply that template to any page with that unique slug. This causes unexpected template assigment. TT4 and TT5 most notably. It's also inconsistent since subsequent untitled pages created in the site editor will use the default template, slugs being unique. Anyway, let's just use WordPress's default behavior, which is to create a unique slug using wp_unique_post_slug if none exists.
  • Loading branch information
ramonjd committed Dec 6, 2024
1 parent cf528bf commit d16b603
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/edit-site/src/components/add-new-post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function AddNewPostModal( { postType, onSave, onClose } ) {
{
status: 'draft',
title,
slug: title || __( 'No title' ),
content:
!! postTypeObject.template &&
postTypeObject.template.length
Expand Down

0 comments on commit d16b603

Please sign in to comment.