WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#5749 closed defect (bug) (fixed)

Advanced Option: Post Slug should be removed

Reported by: lloydbudd Owned by: markjaquith
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: needs-patch
Focuses: Cc:

Description

Advanced Option: Post Slug should be removed

ENV: WP trunk r6702 (2.4-bleeding)

It isn't meaningful if you aren't using pretty permalinks, and if you are using pretty permalinks once you save a post, there is a much cleaner experiening above the post for adjusting the permalink.

Attachments (4)

title_edit_slug_for_new_posts.diff (4.2 KB) - added by filosofo 6 years ago.
edit slug for new post page, on autosave
autosave_stuff.diff (7.0 KB) - added by filosofo 6 years ago.
autosave_on_title_blur.diff (3.8 KB) - added by ryan 6 years ago.
Kick autosave when title goes out of focus and has content
autosave_on_title_blur_with_safari_3.1_support.diff (4.4 KB) - added by markjaquith 6 years ago.
Ryan's patch, but with Tab autosave support in Safari 3.1

Download all attachments as: .zip

Change History (22)

comment:1 markjaquith6 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

It isn't meaningful if you aren't using pretty permalinks

Good point. Perhaps we should hide it if pretty permalinks aren't enabled.

and if you are using pretty permalinks once you save a post, there is a much cleaner experiening above the post for adjusting the permalink.

Adjusting the title post-publishing does not update the post slug, and I wouldn't recommend changing that. Yes, we do have code to redirect to the new post slug, but there is still an SEO hit. Also, some people like to craft custom post slugs that are more elegant than our one-size-fits-all-generated-from-the-title solution.

We can, however, make the post slug interface better. One of the things I really liked from Bryan Veloso's wp-admin mockups was that the post slug editing interface was in the context of the future URL of the post.

http://example.com/2008/02/06/[] /

That is really clever, because it tells people exactly what a post slug is.

comment:2 markjaquith6 years ago

http://example.com/2008/02/06/[________________]/, rather.

comment:3 lloydbudd6 years ago

Replying to markjaquith:

Adjusting the title post-publishing does not update the post slug, and I wouldn't recommend changing that.

Sorry, I don't completely understand your response. Since #5679 the interface on trunk is as you suggest it should be. You save a post, and the post slug editing interface is in the context of the future URL of the post.

comment:4 markjaquith6 years ago

Doh! I hadn't seen that. Although it appears to be broken in Trunk right now.

I see your point now. Though I do think that people need the ability to set their own slug before publishing. Maybe we could rig up that "editable URL" thing to work on your first draft. Then the Advanced Option post slug would be completely redundant.

Here's my vision:

As you type in the title, the slug is populated (right there, below the title, in the context of the URL). Regular rules apply: if you save with the default slug, it isn't locked in. But at any point if you manually edit the post slug, it gets locked down.

comment:5 ryan6 years ago

  • Milestone changed from 2.6 to 2.5

Anyone care to implement that? I'd like to get rid of the slug box at the bottom, but I think we need to address setting the slug for new posts.

filosofo6 years ago

edit slug for new post page, on autosave

comment:6 filosofo6 years ago

  • Keywords has-patch added

I've added a patch that puts the slug preview thing in place on autosave for a new post.

It doesn't change the existing "save" functionality: clicking "save" still does not actually save the slug to the db. To do that we would need to duplicate the slug-fixing algorithm in wp_insert_post. My idea is to move that to a separate function that is used by both wp_insert_post and admin-ajax.

comment:7 ryan6 years ago

Each time I click Edit, the "Permalink:" and "Edit text are duplicated. After two clicks I have this:

Permalink: Permalink: Permalink: http://localhost/trunk/2008/02/20/test-slug/ Edit Edit Edit

Also, pages need this too.

comment:8 ryan6 years ago

My bad, I didn't flush cache. I'll bump the version in script-loader to bust the cache.

comment:9 ryan6 years ago

(In [6954]) Show permalink editor on new posts after autosave. Props filosofo. see #5749

filosofo6 years ago

comment:10 filosofo6 years ago

I added a patch that sets up the slug editor for pages, hides the advanced options slug field for those with JS enabled, shortens the autosave time to 60 seconds, triggers the first autosave early in typing (after 15 characters in the #content textarea), and saves a user-changed slug in autosave.

I had to add a leavename argument to a couple of page permalink functions, to make it parallel to post permalinks and allow page slug editing.

comment:11 ryan6 years ago

(In [6955]) Slug edit for pages. Hide advanced slug field if JS enabled. Trigger first autosave after 15 chars. Set autosave interval to 60s. Props filosofo. see #5749

comment:12 ryan6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:13 nbachiyski6 years ago

The fast first autosave isn't triggered if using TinyMCE, because it is inside iframe and it doesn't get the keypress events.

IMHO, the complexity to implement it isn't worth it.

Another thing: the event handler should be removed after the first autosave.

comment:14 nbachiyski6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:15 azaozz6 years ago

TinyMCE has several methods that can be used here: isDirty() checks for unsaved changes, triggerSave() moves the content from the iframe to the textarea, isHidden() checks which tab is currently selected (Visual or HTML), etc. It can also handle auto-saving nicely when activated, however if HTML mode is used from the beginning, TinyMCE is loaded but not activated. Perhaps we can use TinyMCE's methods when activated or jQuery otherwise.

comment:16 westi6 years ago

  • Keywords needs-patch added; has-patch removed

Marking as needs-patch.

This needs a little bit of work to complete from reading the audit trail above.

ryan6 years ago

Kick autosave when title goes out of focus and has content

markjaquith6 years ago

Ryan's patch, but with Tab autosave support in Safari 3.1

comment:17 markjaquith6 years ago

(In [7394]) Autosave when title has content and loses focus. props ryan. see #5749

comment:18 ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.