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?