Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#19378 closed defect (bug) (fixed)

post_preview() does not apply the preview_post_link filter

Reported by: atetlaw Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Administration Version: 3.2.1
Severity: normal Keywords: has-patch 3.6-early commit
Cc: Focuses:

Description

The post_preview() function (line # 1367 in wp-admin/includes/post.php) does not apply the preview_post_link filter and it probably should.

The code to generate the anchor tag for the post preview button DOES apply the filter and the correct URL is generated. However the button, via javascript, ignores that URL and submits the post form, triggering the 'preview' action in the redirect_post() function. The redirect_post() function obtains the redirect URL from the post_preview() function.

The upshot of that is although the correct URL is generated for the anchor tag for the Preview button, clicking the button opens the standard preview URL.

Attachments (2)

19378.patch (425 bytes ) - added by SergeyBiryukov 14 years ago.
19378.2.patch (1.6 KB ) - added by SergeyBiryukov 14 years ago.

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
14 years ago

  • Component GeneralAdministration
  • Keywords has-patch added

#2 @danielbachhuber
14 years ago

Just ran into this too. Seems like an easy win. 3.6-early?

#3 @danielbachhuber
14 years ago

  • Cc danielbachhuber added

#4 @SergeyBiryukov
14 years ago

  • Keywords 3.6-early added
  • Milestone Awaiting ReviewFuture Release

#5 @danielbachhuber
14 years ago

For other people that need an intermediate solution, here's a workaround I came up with that you can modify to your needs: https://github.com/danielbachhuber/Edit-Flow/commit/79a70d55a2ae482ef9d6df6061dbde12d821e836

#7 @danielbachhuber
14 years ago

19378.2.patch looks pretty good. Thanks SergeyBiryukov

#8 @SergeyBiryukov
14 years ago

  • Milestone Future Release3.6

#9 @SergeyBiryukov
14 years ago

  • Keywords commit added

#10 @SergeyBiryukov
14 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 23560:

Consistently apply 'preview_post_link' filter. fixes #19378.

Note: See TracTickets for help on using tickets.