Ticket #1648: 1648.patch
File 1648.patch, 1.5 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
95 95 add_action( 'wp_head', __NAMESPACE__ . '\\header_js' ); 96 96 add_action( 'add_meta_boxes', __NAMESPACE__ . '\\rename_comments_meta_box', 10, 2 ); 97 97 98 add_filter( 'post_type_link', __NAMESPACE__ . '\\method_permalink', 10, 2 );98 add_filter( 'post_type_link', __NAMESPACE__ . '\\method_permalink', 9, 2 ); 99 99 add_filter( 'term_link', __NAMESPACE__ . '\\taxonomy_permalink', 10, 3 ); 100 100 add_filter( 'the_posts', __NAMESPACE__ . '\\rerun_empty_exact_search', 10, 2 ); 101 101 … … 245 245 } 246 246 247 247 function method_permalink( $link, $post ) { 248 if ( $post->post_type !== 'wp-parser-method' ) 248 global $wp_rewrite; 249 250 if ( !$wp_rewrite->using_permalinks() || ( $post->post_type !== 'wp-parser-method' ) ) { 249 251 return $link; 252 } 250 253 251 254 list( $class, $method ) = explode( '-', $post->post_name ); 252 255 $link = home_url( user_trailingslashit( "reference/classes/$class/$method" ) ); … … 254 257 } 255 258 256 259 function taxonomy_permalink( $link, $term, $taxonomy ) { 260 global $wp_rewrite; 261 262 if ( !$wp_rewrite->using_permalinks() ) { 263 return $link; 264 } 265 257 266 if ( $taxonomy === 'wp-parser-source-file' ) { 258 267 $slug = $term->slug; 259 268 if ( substr( $slug, -4 ) === '-php' ) {