Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#22980 closed enhancement (wontfix)

Get Shortlink button should be appended using the get_sample_permalink_html filter

Reported by: coreygilmore's profile coreygilmore Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Editor Keywords: has-patch
Focuses: Cc:


Currently the Get Shortlink button is appended directly to the output of get_sample_permalink_html(), which makes it impossible (without CSS/JS) to append items to the HTML.

The get_sample_permalink_html filter should be used inside of
edit-form-advanced.php so the user has complete control over the generated output.

Attachments (3)

before-after.png (15.4 KB) - added by coreygilmore 10 years ago.
sample_permalink.diff (2.0 KB) - added by coreygilmore 10 years ago.
22980.diff (2.9 KB) - added by jeremyfelt 9 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
10 years ago

  • Version changed from trunk to 3.5

This ticket was mentioned in IRC in #wordpress-dev by aubreypwd. View the logs.

9 years ago

#4 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 3.9

Looks like sample_permalink.diff would resolve #16478 as well.

9 years ago

#5 @jeremyfelt
9 years ago

22980.diff refreshes @coreygilmore's patch against the latest trunk and adapts it to other recent changes in edit-form-advanced.php.

I put the filter in default-filters.php as it needs to run on an ajax request as well to be completely effective. When the filter is enabled here, both this ticket and #16478 are resolved for me.

#6 @nacin
9 years ago

admin-ajax.php does a full load of the admin bootstrap so inlining it is fine. However, it should happen on include so a plugin could still de-register it on admin_init.

I'm also going to go with priority 20, that way any existing usage of the hook on the default priority doesn't suddenly get moved around.

#7 @nacin
9 years ago

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

I was about two keystrokes from committing this when I realized the filter in get_sample_permalink_html() should be for the sample permalink HTML only. Not a shortlink or, for that matter, the View Post button.

Really what we need is a new hook for all three of these to be latched onto, which would fix #22980 (this), #16478, and #16477. This change is opposite of what's being proposed in #16477 which gave me the initial pause. Closing as wontfix — this should be addressed in #16477 and #16478, both also slated for 3.9.

Note: See TracTickets for help on using tickets.