[wp-trac] [WordPress Trac] #39321: Issue with get_permalink when using wp_update_post() and %author% is part of your permalink

WordPress Trac noreply at wordpress.org
Fri Dec 23 12:51:59 UTC 2016


#39321: Issue with get_permalink when using wp_update_post() and %author% is part
of your permalink
--------------------------+------------------------------
 Reporter:  mauteri       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:
--------------------------+------------------------------

Comment (by mauteri):

 Thanks Boone!

 I was programmatically importing and updating data when I noticed this.
 With this part:
 `Your change would make this worse, since the structure of the URL would
 be different for authorless revisions: example.com/authorname/postname vs
 example.com/postname. Perhaps revisions should always have permalinks of
 the form ?p=123, as is the case with draft, pending, auto-draft, and
 future.`
 Not actually true, because in this situation `$author =
 $authordata->user_nicename;` never actually worked since `post_author=0`,
 `$authordata` is not an object and `$authordata->user_nicename;` is just
 `NULL`, so it would actually just remain the same but with the added bonus
 of not throwing a PHP Notice :-)

 I like the idea of reverting to non-pretty permalinks for revisions as I
 think this is the safest course of action and follows suit with draft,
 pending, auto-draft statuses.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39321#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list