diff --git a/functions.php b/functions.php
index 289f45d..284a70c 100644
a
|
b
|
function register_post_types() { |
164 | 164 | 'public' => true, |
165 | 165 | 'rewrite' => array( |
166 | 166 | 'feeds' => false, |
167 | | 'slug' => 'reference/functions', |
| 167 | 'slug' => 'reference/function', |
168 | 168 | 'with_front' => false, |
169 | 169 | ), |
| 170 | 'has_archive' => 'reference/functions', |
170 | 171 | 'supports' => $supports, |
171 | 172 | ) ); |
172 | 173 | |
173 | 174 | // Methods |
174 | 175 | add_rewrite_rule( 'reference/classes/page/([0-9]{1,})/?$', 'index.php?post_type=wp-parser-class&paged=$matches[1]', 'top' ); |
175 | | add_rewrite_rule( 'reference/classes/([^/]+)/([^/]+)/?$', 'index.php?post_type=wp-parser-method&name=$matches[1]-$matches[2]', 'top' ); |
| 176 | add_rewrite_rule( 'reference/class/([^/]+)/([^/]+)/?$', 'index.php?post_type=wp-parser-method&name=$matches[1]-$matches[2]', 'top' ); |
176 | 177 | |
177 | 178 | // Classes |
178 | 179 | register_post_type( 'wp-parser-class', array( |
… |
… |
function register_post_types() { |
196 | 197 | 'public' => true, |
197 | 198 | 'rewrite' => array( |
198 | 199 | 'feeds' => false, |
199 | | 'slug' => 'reference/classes', |
| 200 | 'slug' => 'reference/class', |
200 | 201 | 'with_front' => false, |
201 | 202 | ), |
202 | 203 | 'supports' => $supports, |
… |
… |
function register_post_types() { |
224 | 225 | 'public' => true, |
225 | 226 | 'rewrite' => array( |
226 | 227 | 'feeds' => false, |
227 | | 'slug' => 'reference/hooks', |
| 228 | 'slug' => 'reference/hook', |
228 | 229 | 'with_front' => false, |
229 | 230 | ), |
| 231 | 'has_archive' => 'reference/hooks', |
230 | 232 | 'supports' => $supports, |
231 | 233 | ) ); |
232 | 234 | |
… |
… |
function register_post_types() { |
252 | 254 | 'public' => true, |
253 | 255 | 'rewrite' => array( |
254 | 256 | 'feeds' => false, |
255 | | 'slug' => 'classes', |
| 257 | 'slug' => 'class', |
256 | 258 | 'with_front' => false, |
257 | 259 | ), |
258 | 260 | 'supports' => $supports, |
… |
… |
function register_taxonomies() { |
286 | 288 | 'public' => true, |
287 | 289 | // Hierarchical x 2 to enable (.+) rather than ([^/]+) for rewrites. |
288 | 290 | 'hierarchical' => true, |
289 | | 'rewrite' => array( 'slug' => 'reference/files', 'hierarchical' => true ), |
| 291 | 'rewrite' => array( 'slug' => 'reference/source_files', 'hierarchical' => true ), |
290 | 292 | 'sort' => false, |
291 | 293 | 'update_count_callback' => '_update_post_term_count', |
292 | 294 | ) ); |
… |
… |
function method_permalink( $link, $post ) { |
317 | 319 | return $link; |
318 | 320 | |
319 | 321 | list( $class, $method ) = explode( '-', $post->post_name ); |
320 | | $link = home_url( user_trailingslashit( "reference/classes/$class/$method" ) ); |
| 322 | $link = home_url( user_trailingslashit( "reference/class/$class/$method" ) ); |
321 | 323 | return $link; |
322 | 324 | } |
323 | 325 | |
… |
… |
function taxonomy_permalink( $link, $term, $taxonomy ) { |
328 | 330 | $slug = substr( $slug, 0, -4 ) . '.php'; |
329 | 331 | $slug = str_replace( '_', '/', $slug ); |
330 | 332 | } |
331 | | $link = home_url( user_trailingslashit( "reference/files/$slug" ) ); |
| 333 | $link = home_url( user_trailingslashit( "reference/source_files/$slug" ) ); |
332 | 334 | } elseif ( $taxonomy === 'wp-parser-since' ) { |
333 | 335 | $link = str_replace( $term->slug, str_replace( '-', '.', $term->slug ), $link ); |
334 | 336 | } |