Changeset 5700 for trunk/wp-includes/link-template.php
- Timestamp:
- 06/14/2007 02:25:30 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/link-template.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r5611 r5700 274 274 function get_edit_post_link( $id = 0 ) { 275 275 $post = &get_post( $id ); 276 276 277 277 if ( $post->post_type == 'attachment' ) { 278 278 return; … … 280 280 if ( !current_user_can( 'edit_page', $post->ID ) ) 281 281 return; 282 282 283 283 $file = 'page'; 284 284 } else { 285 285 if ( !current_user_can( 'edit_post', $post->ID ) ) 286 286 return; 287 287 288 288 $file = 'post'; 289 289 } 290 290 291 291 return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . '/wp-admin/' . $file . '.php?action=edit&post=' . $post->ID, $post->ID ); 292 292 } … … 300 300 if ( !current_user_can( 'edit_page', $post->ID ) ) 301 301 return; 302 302 303 303 $file = 'page'; 304 304 } else { 305 305 if ( !current_user_can( 'edit_post', $post->ID ) ) 306 306 return; 307 307 308 308 $file = 'post'; 309 309 } … … 316 316 $comment = &get_comment( $comment_id ); 317 317 $post = &get_post( $comment->comment_post_ID ); 318 318 319 319 if ( $post->post_type == 'attachment' ) { 320 320 return; … … 454 454 function get_pagenum_link($pagenum = 1) { 455 455 global $wp_rewrite; 456 456 457 457 $pagenum = (int) $pagenum; 458 458 459 459 $request = remove_query_arg( 'paged' ); 460 460 461 461 $home_root = parse_url(get_option('home')); 462 462 $home_root = $home_root['path']; 463 463 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); 464 464 465 465 $request = preg_replace('|^'. $home_root . '|', '', $request); 466 466 $request = preg_replace('|^/+|', '', $request); 467 467 468 468 if ( !$wp_rewrite->using_permalinks() || is_admin() ) { 469 469 $base = trailingslashit( get_bloginfo( 'home' ) ); … … 477 477 $qs_regex = '|\?.*?$|'; 478 478 preg_match( $qs_regex, $request, $qs_match ); 479 479 480 480 if ( $qs_match[0] ) { 481 481 $query_string = $qs_match[0]; … … 484 484 $query_string = ''; 485 485 } 486 486 487 487 $request = preg_replace( '|page/(.+)/?$|', '', $request); 488 488 489 489 $base = trailingslashit( get_bloginfo( 'url' ) ); 490 490 491 491 if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) { 492 492 $base .= 'index.php/'; 493 493 } 494 494 495 495 if ( $pagenum > 1 ) { 496 496 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' ); 497 497 } 498 498 499 499 $result = $base . $request . $query_string; 500 500 } 501 501 502 502 return $result; 503 503 }
Note: See TracChangeset
for help on using the changeset viewer.