Ticket #813: 813.2.patch
File 813.2.patch, 937 bytes (added by , 10 years ago) |
---|
-
wporg-specifics.php
11 11 $this->add_action( 'before_login_form' ); 12 12 $this->add_filter( 'gp_url_profile', array( 'args' => 2 ) ); 13 13 $this->add_filter( 'routes' ); 14 $this->add_filter( 'projects', array( 'args' => 2 ) ); 14 15 } 15 16 16 17 function before_login_form() { … … 25 26 unset( $routes['get:/profile/(.+?)'] ); 26 27 return $routes; 27 28 } 29 30 function projects( $sub_projects, $parent_id ) { 31 if ( 1 != $parent_id && 13 != $parent_id ) { // 1 = WordPress, 13 = BuddyPress 32 return $sub_projects; 33 } 34 35 /* 36 * Natural sorting for sub projects. 37 * 38 * 3.0.x 39 * 4.0.x 40 * 3.1.x 41 * 4.1.x 42 * => 43 * 4.1.x 44 * 4.0.x 45 * 3.1.x 46 * 3.0.x 47 */ 48 usort( $sub_projects, function( $a, $b ) { 49 return - strcasecmp( $a->name, $b->name ); 50 }); 51 52 return $sub_projects; 53 } 28 54 } 29 55 GP::$plugins->wporg_specifics = new GP_WPorg_Specifics;