Make WordPress Core

Opened 11 years ago

Closed 9 years ago

#27726 closed defect (bug) (wontfix)

Get Shortlink button isn't shown on draft posts

Reported by: tomdxw's profile tomdxw Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

In version 3.6 when you are editing a draft post there is a "Get Shortlink" button below the title. But in 3.7 and 3.8 that button only appears after the post has been published.

One of our clients was using that button to place links from draft pages to other draft pages (apparently using the full permalink didn't work for them, I assume they changed the titles before hitting the publish button).

The code which changed is line 447 of wp-admin/edit-form-advanced.php:

if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )

(Removing "$shortlink !== $permalink && " would fix the regression.)

Attachments (2)

27726.diff (1.3 KB) - added by MikeHansenMe 11 years ago.
Patched based on comment and minor code standards improvement
27726.2.diff (1.7 KB) - added by MikeHansenMe 10 years ago.

Download all attachments as: .zip

Change History (11)

#1 @wonderboymusic
11 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

@MikeHansenMe
11 years ago

Patched based on comment and minor code standards improvement

#2 @voldemortensen
11 years ago

  • Keywords has-patch added; needs-patch removed

#3 @Der-Bank-Blog
10 years ago

The button is still missed. It would be great to have it back

#4 @MikeHansenMe
9 years ago

  • Milestone changed from Future Release to 4.4

Patch still applies lets get this in 4.4

#5 @helen
9 years ago

Out of curiosity, what are people using this button for these days, now that URL shortening is usually done through a service of some variety? Is it useful in its default state (that is, without a plugin for running shortlinks via said service)?

This ticket was mentioned in Slack in #core by sergey. View the logs.


9 years ago

#7 @SergeyBiryukov
9 years ago

Appears to be broken in [25030].

Last edited 9 years ago by SergeyBiryukov (previous) (diff)

#8 in reply to: ↑ description @kraftbj
9 years ago

One of our clients was using that button to place links from draft pages to other draft pages (apparently using the full permalink didn't work for them, I assume they changed the titles before hitting the publish button).

They're using the "dirty"/default permalink, it sounds like (e.g. https://example.com/?p=123456 ) since no matter what the actual pretty permalink ends up being or changed in the future, it'll properly redirect to it (as opposed to traditional "shortlink" usage to have a smaller URL for a permanent permalink).

The removal of the shortlink when the permalink matches makes sense generally—sites using the default permalinks don't need the shortlink button since it is the same—but does trip up folks using it as a permalink for a to-be-published post.

As a middle ground, if the post is unpublished, revert to the old behavior. If the post is published and the site is using default permalink, retain the new behavior?

#9 @wonderboymusic
9 years ago

  • Milestone 4.4 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

As per [34556]

Note: See TracTickets for help on using tickets.