[Bb-trac] Re: [bbPress] #739: "tags" permalink for tag browsing should be singular, not plural, for consistency

bbPress bb-trac at lists.bbpress.org
Tue Mar 4 22:39:11 GMT 2008


#739: "tags" permalink for tag browsing should be singular, not plural, for
consistency
--------------------------+-------------------------------------------------
 Reporter:  JeremyVisser  |        Owner:  sambauers      
     Type:  defect        |       Status:  assigned       
 Priority:  normal        |    Milestone:  0.8.5 & XML-RPC
Component:  Front-end     |      Version:  0.8.2.1        
 Severity:  minor         |   Resolution:                 
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------
Changes (by mdawaffe):

  * milestone:  0.8.4 => 0.8.5 & XML-RPC

Comment:

 This can now be done via plugin and a rewrite rule.

 Proof of concept plugin:

 {{{
 <?php

 /*
 Plugin Name: Singluar Tags
 */

 function singular_tags_tag_link( $url ) {
         return str_replace( '/tags/', '/tag/', $url );
 }

 function singular_tags_admin_menu() {
         bb_admin_add_submenu( 'Singular Tags', 'manage_options',
 'singular_tags_admin_page', 'plugins.php' );
 }

 function singular_tags_admin_page() {
 ?>

 <p>You must have mod_rewrite and you must include the following rewrite
 rules in your .htaccess file.</p>

 <pre><code>
 RewriteEngine On
 RewriteBase /~michael/bbPress/

 RewriteRule ^tag/([^/]+)/?$ /~michael/bbPress/tags.php?tag=$1 [L,QSA]
 RewriteRule ^tag/?$ /~michael/bbPress/tags.php [L,QSA]
 </code></pre>

 <?php

 }

 add_filter( 'bb_get_tag_link', 'singular_tags_tag_link' );
 add_action( 'bb_admin_menu_generator', 'singular_tags_admin_menu' );
 }}}

-- 
Ticket URL: <http://trac.bbpress.org/ticket/739#comment:9>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list