[wp-trac] [WordPress Trac] #4860: Comments popup page needs a pretty URL

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 29 13:02:37 GMT 2007


#4860: Comments popup page needs a pretty URL
--------------------------+-------------------------------------------------
 Reporter:  JeremyVisser  |       Owner:  anonymous 
     Type:  enhancement   |      Status:  new       
 Priority:  low           |   Milestone:  2.4 (next)
Component:  General       |     Version:  2.3       
 Severity:  minor         |    Keywords:            
--------------------------+-------------------------------------------------
 Currently, the URL provided by {{{comments_popup_link()}}} to provide a
 link to a separate comments window looks like this:

 {{{
 http://localhost/wordpress/?comments_popup=13
 }}}

 It looks ugly, and is like that even when pretty permalinks are enabled.

 Now, it'd be better if it were accessible from this URL:

 {{{
 http://localhost/wordpress/comments/popup/13
 }}}

 or maybe even this

 {{{
 http://localhost/wordpress/2007/01/01/hello-world/comments/
 }}}

 I managed to get the popup form accessible from
 {{{http://localhost/wordpress/comments/popup/13}}} with a plugin. The
 significant code I used was (using the skills I learned today from DD32 --
 thanks!):

 {{{
 function cp_comments_popup_rewrite_rules( $rules ) {
         $rules[ 'comments/popup/([0-9]+)' ] =
 'index.php?comments_popup=$matches[1]';
         return $rules;
 }

 add_filter('rewrite_rules_array', 'cp_comments_popup_rewrite_rules');
 }}}

 However, it'd be better in core. From looking at the code, I was wondering
 if it should go in the {{{WP_Rewrite::generate_rewrite_rules()}}}
 function, but I've been staring at that function for about 10 minutes now,
 and now my eyes are all blurry. I don't understand it one bit.

 How else can we acheive this?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4860>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list