[wp-trac] [WordPress Trac] #12870: Edit page for custom post type not showing slug & pretty permalink

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 16 22:58:18 UTC 2010


#12870: Edit page for custom post type not showing slug & pretty permalink
--------------------------+-------------------------------------------------
 Reporter:  vlasky        |        Owner:  dd32    
     Type:  defect (bug)  |       Status:  accepted
 Priority:  normal        |    Milestone:  3.0     
Component:  Post Types    |      Version:  3.0     
 Severity:  normal        |   Resolution:          
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------
Changes (by duck_):

  * keywords:  has-patch needs-testing => has-patch


Comment:

 Replying to [comment:7 dd32]:
 > I just noticed that the slug displayed may not be correct, for example,
 It showed /note/test/ in hte slug preview, and /note/test-6/ after a draft
 save when it realised test was already taken.

 Problem was that autosave.js was not sending a new_slug to admin-ajax.php,
 if this isn't set then it defaults to empty string.
 get_sample_permalink(_html) use null as a default for this value, so even
 though a unique slug was retrieved in the get_sample_permalink function it
 was overwritten because {{{$name}}} (aka the new_slug) was not null. Fix
 sets default for unset new_slug to be null. Also move the check for a new
 name in get_sample_permalink to before the unique slug call so that the
 same problem doesn't happen when editing the permalink of an existing post
 (try this now and you'll see that the number suffix isn't added until
 save).

 PS, the patch also includes minor optimisation of _get_page_link function
 from link-template.php

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12870#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list