Ticket #24164: get_the_permalink_alias.patch
File get_the_permalink_alias.patch, 44.1 KB (added by , 11 years ago) |
---|
-
wp-admin/edit-form-advanced.php
32 32 $messages = array(); 33 33 $messages['post'] = array( 34 34 0 => '', // Unused. Messages start at index 1. 35 1 => sprintf( __('Post updated. <a href="%s">View post</a>'), esc_url( get_ permalink($post_ID) ) ),35 1 => sprintf( __('Post updated. <a href="%s">View post</a>'), esc_url( get_the_permalink($post_ID) ) ), 36 36 2 => __('Custom field updated.'), 37 37 3 => __('Custom field deleted.'), 38 38 4 => __('Post updated.'), 39 39 /* translators: %s: date and time of the revision */ 40 40 5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 41 6 => sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( get_ permalink($post_ID) ) ),41 6 => sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( get_the_permalink($post_ID) ) ), 42 42 7 => __('Post saved.'), 43 8 => sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_ permalink($post_ID) ) ) ),43 8 => sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_the_permalink($post_ID) ) ) ), 44 44 9 => sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'), 45 45 // translators: Publish box date format, see http://php.net/date 46 date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_ permalink($post_ID) ) ),47 10 => sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_ permalink($post_ID) ) ) ),46 date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_the_permalink($post_ID) ) ), 47 10 => sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_the_permalink($post_ID) ) ) ), 48 48 ); 49 49 $messages['page'] = array( 50 50 0 => '', // Unused. Messages start at index 1. 51 1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( get_ permalink($post_ID) ) ),51 1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( get_the_permalink($post_ID) ) ), 52 52 2 => __('Custom field updated.'), 53 53 3 => __('Custom field deleted.'), 54 54 4 => __('Page updated.'), 55 55 5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 56 6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( get_ permalink($post_ID) ) ),56 6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( get_the_permalink($post_ID) ) ), 57 57 7 => __('Page saved.'), 58 8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_ permalink($post_ID) ) ) ),59 9 => sprintf( __('Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_ permalink($post_ID) ) ),60 10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_ permalink($post_ID) ) ) ),58 8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_the_permalink($post_ID) ) ) ), 59 9 => sprintf( __('Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_the_permalink($post_ID) ) ), 60 10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_the_permalink($post_ID) ) ) ), 61 61 ); 62 62 $messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now. 63 63 -
wp-admin/includes/ajax-actions.php
1274 1274 function wp_ajax_get_permalink() { 1275 1275 check_ajax_referer( 'getpermalink', 'getpermalinknonce' ); 1276 1276 $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; 1277 wp_die( add_query_arg( array( 'preview' => 'true' ), get_ permalink( $post_id ) ) );1277 wp_die( add_query_arg( array( 'preview' => 'true' ), get_the_permalink( $post_id ) ) ); 1278 1278 } 1279 1279 1280 1280 function wp_ajax_sample_permalink() { -
wp-admin/includes/class-wp-comments-list-table.php
504 504 $this->comments_bubble( $post->ID, $pending_comments ); 505 505 echo '</span> '; 506 506 $post_type_object = get_post_type_object( $post->post_type ); 507 echo "<a href='" . get_ permalink( $post->ID ) . "'>" . $post_type_object->labels->view_item . '</a>';507 echo "<a href='" . get_the_permalink( $post->ID ) . "'>" . $post_type_object->labels->view_item . '</a>'; 508 508 echo '</div>'; 509 509 if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) ) 510 510 echo $thumb; -
wp-admin/includes/class-wp-media-list-table.php
404 404 $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; 405 405 $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 406 406 } 407 $actions['view'] = '<a href="' . get_ permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';407 $actions['view'] = '<a href="' . get_the_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 408 408 if ( current_user_can( 'edit_post', $post->ID ) ) 409 409 $actions['attach'] = '<a href="#the-list" onclick="findPosts.open( \'media[]\',\''.$post->ID.'\' );return false;" class="hide-if-no-js">'.__( 'Attach' ).'</a>'; 410 410 } … … 423 423 } 424 424 if ( !$this->is_trash ) { 425 425 $title =_draft_or_post_title( $post->post_parent ); 426 $actions['view'] = '<a href="' . get_ permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';426 $actions['view'] = '<a href="' . get_the_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 427 427 } 428 428 } 429 429 -
wp-admin/includes/class-wp-posts-list-table.php
587 587 if ( $post_type_object->public ) { 588 588 if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { 589 589 if ( $can_edit_post ) 590 $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', get_ permalink( $post->ID ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';590 $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', get_the_permalink( $post->ID ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 591 591 } elseif ( 'trash' != $post->post_status ) { 592 $actions['view'] = '<a href="' . get_ permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';592 $actions['view'] = '<a href="' . get_the_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 593 593 } 594 594 } 595 595 -
wp-admin/includes/dashboard.php
461 461 462 462 $drafts = false; 463 463 if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) { 464 $view = get_ permalink( $_POST['post_ID'] );464 $view = get_the_permalink( $_POST['post_ID'] ); 465 465 $edit = esc_url( get_edit_post_link( $_POST['post_ID'] ) ); 466 466 if ( 'post-quickpress-publish' == $_POST['action'] ) { 467 467 if ( current_user_can('publish_posts') ) -
wp-admin/includes/media.php
1189 1189 $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; 1190 1190 } 1191 1191 1192 $attachment_url = get_ permalink( $attachment_id );1192 $attachment_url = get_the_permalink( $attachment_id ); 1193 1193 1194 1194 $item = " 1195 1195 $type_html -
wp-admin/includes/meta-boxes.php
38 38 <div id="preview-action"> 39 39 <?php 40 40 if ( 'publish' == $post->post_status ) { 41 $preview_link = esc_url( get_ permalink( $post->ID ) );41 $preview_link = esc_url( get_the_permalink( $post->ID ) ); 42 42 $preview_button = __( 'Preview Changes' ); 43 43 } else { 44 $preview_link = set_url_scheme( get_ permalink( $post->ID ) );44 $preview_link = set_url_scheme( get_the_permalink( $post->ID ) ); 45 45 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); 46 46 $preview_button = __( 'Preview' ); 47 } 48 ?> 47 }?> 49 48 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview"><?php echo $preview_button; ?></a> 50 49 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> 51 50 </div> -
wp-admin/includes/post.php
995 995 $original_date = $post->post_date; 996 996 $original_name = $post->post_name; 997 997 998 // Hack: get_ permalink would return ugly permalink for998 // Hack: get_the_permalink would return ugly permalink for 999 999 // drafts, so we will fake, that our post is published 1000 1000 if ( in_array($post->post_status, array('draft', 'pending')) ) { 1001 1001 $post->post_status = 'publish'; … … 1011 1011 1012 1012 $post->filter = 'sample'; 1013 1013 1014 $permalink = get_ permalink($post, true);1014 $permalink = get_the_permalink($post, true); 1015 1015 1016 1016 // Replace custom post_type Token with generic pagename token for ease of use. 1017 1017 $permalink = str_replace("%$post->post_type%", '%pagename%', $permalink); … … 1212 1212 <?php 1213 1213 1214 1214 if ( $locked ) { 1215 $preview_link = set_url_scheme( add_query_arg( 'preview', 'true', get_ permalink( $post->ID ) ) );1215 $preview_link = set_url_scheme( add_query_arg( 'preview', 'true', get_the_permalink( $post->ID ) ) ); 1216 1216 1217 1217 if ( 'publish' == $post->post_status || $user->ID != $post->post_author ) { 1218 1218 // Latest content is in autosave … … 1378 1378 wp_die( $id->get_error_message() ); 1379 1379 1380 1380 if ( $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) { 1381 $url = add_query_arg( 'preview', 'true', get_ permalink($id) );1381 $url = add_query_arg( 'preview', 'true', get_the_permalink($id) ); 1382 1382 } else { 1383 1383 $nonce = wp_create_nonce('post_preview_' . $id); 1384 $url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $id, 'preview_nonce' => $nonce ), get_ permalink($id) );1384 $url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $id, 'preview_nonce' => $nonce ), get_the_permalink($id) ); 1385 1385 } 1386 1386 1387 1387 return apply_filters( 'preview_post_link', $url ); -
wp-admin/includes/upgrade.php
557 557 $post_title = addslashes(deslash($post->post_title)); 558 558 $post_excerpt = addslashes(deslash($post->post_excerpt)); 559 559 if ( empty($post->guid) ) 560 $guid = get_ permalink($post->ID);560 $guid = get_the_permalink($post->ID); 561 561 else 562 562 $guid = $post->guid; 563 563 -
wp-admin/press-this.php
574 574 $post_ID = intval($posted); ?> 575 575 <div id="message" class="updated"> 576 576 <p><strong><?php _e('Your post has been saved.'); ?></strong> 577 <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_ permalink($post_ID); ?>"><?php _e('View post'); ?></a>577 <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_the_permalink($post_ID); ?>"><?php _e('View post'); ?></a> 578 578 | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit Post'); ?></a> 579 579 | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p> 580 580 </div> -
wp-includes/admin-bar.php
438 438 $wp_admin_bar->add_menu( array( 439 439 'id' => 'view', 440 440 'title' => $post_type_object->labels->view_item, 441 'href' => get_ permalink( $post->ID )441 'href' => get_the_permalink( $post->ID ) 442 442 ) ); 443 443 } elseif ( 'edit-tags' == $current_screen->base 444 444 && isset( $tag ) && is_object( $tag ) -
wp-includes/canonical.php
83 83 if ( 'revision' == $vars->post_type && $vars->post_parent > 0 ) 84 84 $id = $vars->post_parent; 85 85 86 if ( $redirect_url = get_ permalink($id) )86 if ( $redirect_url = get_the_permalink($id) ) 87 87 $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); 88 88 } 89 89 } … … 96 96 if ( $id && $redirect_post = get_post($id) ) { 97 97 $post_type_obj = get_post_type_object($redirect_post->post_type); 98 98 if ( $post_type_obj->public ) { 99 $redirect_url = get_ permalink($redirect_post);99 $redirect_url = get_the_permalink($redirect_post); 100 100 $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); 101 101 } 102 102 } … … 113 113 if ( $redirect_url = get_attachment_link(get_query_var('attachment_id')) ) 114 114 $redirect['query'] = remove_query_arg('attachment_id', $redirect['query']); 115 115 } elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) { 116 if ( $redirect_url = get_ permalink(get_query_var('p')) )116 if ( $redirect_url = get_the_permalink(get_query_var('p')) ) 117 117 $redirect['query'] = remove_query_arg(array('p', 'post_type'), $redirect['query']); 118 118 } elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { 119 if ( $redirect_url = get_ permalink( $wp_query->get_queried_object_id() ) )119 if ( $redirect_url = get_the_permalink( $wp_query->get_queried_object_id() ) ) 120 120 $redirect['query'] = remove_query_arg('name', $redirect['query']); 121 121 } elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { 122 if ( $redirect_url = get_ permalink(get_query_var('page_id')) )122 if ( $redirect_url = get_the_permalink(get_query_var('page_id')) ) 123 123 $redirect['query'] = remove_query_arg('page_id', $redirect['query']); 124 124 } elseif ( is_page() && !is_feed() && isset($wp_query->queried_object) && 'page' == get_option('show_on_front') && $wp_query->queried_object->ID == get_option('page_on_front') && ! $redirect_url ) { 125 125 $redirect_url = home_url('/'); 126 126 } elseif ( is_home() && !empty($_GET['page_id']) && 'page' == get_option('show_on_front') && get_query_var('page_id') == get_option('page_for_posts') && ! $redirect_url ) { 127 if ( $redirect_url = get_ permalink(get_option('page_for_posts')) )127 if ( $redirect_url = get_the_permalink(get_option('page_for_posts')) ) 128 128 $redirect['query'] = remove_query_arg('page_id', $redirect['query']); 129 129 } elseif ( !empty($_GET['m']) && ( is_year() || is_month() || is_day() ) ) { 130 130 $m = get_query_var('m'); … … 207 207 $category = get_category_by_path( $cat ); 208 208 $post_terms = wp_get_object_terms($wp_query->get_queried_object_id(), 'category', array('fields' => 'tt_ids')); 209 209 if ( (!$category || is_wp_error($category)) || ( !is_wp_error($post_terms) && !empty($post_terms) && !in_array($category->term_taxonomy_id, $post_terms) ) ) 210 $redirect_url = get_ permalink($wp_query->get_queried_object_id());210 $redirect_url = get_the_permalink($wp_query->get_queried_object_id()); 211 211 } 212 212 213 213 // Post Paging 214 214 if ( is_singular() && ! is_front_page() && get_query_var('page') ) { 215 215 if ( !$redirect_url ) 216 $redirect_url = get_ permalink( get_queried_object_id() );216 $redirect_url = get_the_permalink( get_queried_object_id() ); 217 217 $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); 218 218 $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); 219 219 } … … 495 495 if ( get_query_var( 'feed' ) ) 496 496 return get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) ); 497 497 elseif ( get_query_var( 'page' ) ) 498 return trailingslashit( get_ permalink( $post_id ) ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );498 return trailingslashit( get_the_permalink( $post_id ) ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); 499 499 else 500 return get_ permalink( $post_id );500 return get_the_permalink( $post_id ); 501 501 } 502 502 503 503 return false; -
wp-includes/category-template.php
457 457 } 458 458 } else { 459 459 if ( ! empty( $show_option_all ) ) { 460 $posts_page = ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) ) ? get_ permalink( get_option( 'page_for_posts' ) ) : home_url( '/' );460 $posts_page = ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) ) ? get_the_permalink( get_option( 'page_for_posts' ) ) : home_url( '/' ); 461 461 $posts_page = esc_url( $posts_page ); 462 462 if ( 'list' == $style ) 463 463 $output .= "<li><a href='$posts_page'>$show_option_all</a></li>"; -
wp-includes/class-wp-editor.php
800 800 $results[] = array( 801 801 'ID' => $post->ID, 802 802 'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ), 803 'permalink' => get_ permalink( $post->ID ),803 'permalink' => get_the_permalink( $post->ID ), 804 804 'info' => $info, 805 805 ); 806 806 } -
wp-includes/comment-template.php
497 497 $args['page'] = ( !empty($in_comment_loop) ) ? get_query_var('cpage') : get_page_of_comment( $comment->comment_ID, $args ); 498 498 499 499 if ( $wp_rewrite->using_permalinks() ) 500 $link = user_trailingslashit( trailingslashit( get_ permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' );500 $link = user_trailingslashit( trailingslashit( get_the_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' ); 501 501 else 502 $link = add_query_arg( 'cpage', $args['page'], get_ permalink( $comment->comment_post_ID ) );502 $link = add_query_arg( 'cpage', $args['page'], get_the_permalink( $comment->comment_post_ID ) ); 503 503 } else { 504 $link = get_ permalink( $comment->comment_post_ID );504 $link = get_the_permalink( $comment->comment_post_ID ); 505 505 } 506 506 507 507 return apply_filters( 'get_comment_link', $link . '#comment-' . $comment->comment_ID, $comment, $args ); … … 516 516 * @return string The link to the comments 517 517 */ 518 518 function get_comments_link($post_id = 0) { 519 return apply_filters( 'get_comments_link', get_ permalink( $post_id ) . '#comments', $post_id );519 return apply_filters( 'get_comments_link', get_the_permalink( $post_id ) . '#comments', $post_id ); 520 520 } 521 521 522 522 /** … … 705 705 */ 706 706 function get_trackback_url() { 707 707 if ( '' != get_option('permalink_structure') ) { 708 $tb_url = trailingslashit(get_ permalink()) . user_trailingslashit('trackback', 'single_trackback');708 $tb_url = trailingslashit(get_the_permalink()) . user_trailingslashit('trackback', 'single_trackback'); 709 709 } else { 710 710 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID(); 711 711 } … … 997 997 echo '" onclick="wpopen(this.href); return false"'; 998 998 } else { // if comments_popup_script() is not in the template, display simple comment link 999 999 if ( 0 == $number ) 1000 echo get_ permalink() . '#respond';1000 echo get_the_permalink() . '#respond'; 1001 1001 else 1002 1002 comments_link(); 1003 1003 echo '"'; … … 1056 1056 $link = ''; 1057 1057 1058 1058 if ( get_option('comment_registration') && !$user_ID ) 1059 $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_ permalink() ) ) . '">' . $login_text . '</a>';1059 $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_the_permalink() ) ) . '">' . $login_text . '</a>'; 1060 1060 else 1061 1061 $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 1062 1062 return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post); … … 1107 1107 return false; 1108 1108 1109 1109 if ( get_option('comment_registration') && !$user_ID ) { 1110 $link = '<a rel="nofollow" href="' . wp_login_url( get_ permalink() ) . '">' . $login_text . '</a>';1110 $link = '<a rel="nofollow" href="' . wp_login_url( get_the_permalink() ) . '">' . $login_text . '</a>'; 1111 1111 } else { 1112 $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_ permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";1112 $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_the_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 1113 1113 } 1114 1114 return apply_filters('post_comments_link', $before . $link . $after, $post); 1115 1115 } … … 1624 1624 $defaults = array( 1625 1625 'fields' => apply_filters( 'comment_form_default_fields', $fields ), 1626 1626 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 1627 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_ permalink( $post_id ) ) ) ) . '</p>',1628 'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_ permalink( $post_id ) ) ) ) . '</p>',1627 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_the_permalink( $post_id ) ) ) ) . '</p>', 1628 'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_the_permalink( $post_id ) ) ) ) . '</p>', 1629 1629 'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>', 1630 1630 'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>', 1631 1631 'id_form' => 'commentform', -
wp-includes/comment.php
1854 1854 if ( $pingback_server_url ) { 1855 1855 @ set_time_limit( 60 ); 1856 1856 // Now, the RPC call 1857 $pagelinkedfrom = get_ permalink($post_ID);1857 $pagelinkedfrom = get_the_permalink($post_ID); 1858 1858 1859 1859 // using a timeout of 3 seconds should be enough to cover slow servers 1860 1860 $client = new WP_HTTP_IXR_Client($pingback_server_url); … … 1908 1908 $options['timeout'] = 4; 1909 1909 $options['body'] = array( 1910 1910 'title' => $title, 1911 'url' => get_ permalink($ID),1911 'url' => get_the_permalink($ID), 1912 1912 'blog_name' => get_option('blogname'), 1913 1913 'excerpt' => $excerpt 1914 1914 ); -
wp-includes/deprecated.php
147 147 if ( !$post ) 148 148 return; 149 149 150 $string = '<a href="'.get_ permalink($post->ID).'">'.$previous;150 $string = '<a href="'.get_the_permalink($post->ID).'">'.$previous; 151 151 if ( 'yes' == $title ) 152 152 $string .= apply_filters('the_title', $post->post_title, $post->ID); 153 153 $string .= '</a>'; … … 183 183 if ( !$post ) 184 184 return; 185 185 186 $string = '<a href="'.get_ permalink($post->ID).'">'.$next;186 $string = '<a href="'.get_the_permalink($post->ID).'">'.$next; 187 187 if ( 'yes' == $title ) 188 188 $string .= apply_filters('the_title', $post->post_title, $post->ID); 189 189 $string .= '</a>'; … … 2739 2739 2740 2740 $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; 2741 2741 $link .= esc_attr($title); 2742 $link .= "' href='" . get_ permalink($post) . "' />\n";2742 $link .= "' href='" . get_the_permalink($post) . "' />\n"; 2743 2743 2744 2744 $boundary = $start ? 'start' : 'end'; 2745 2745 return apply_filters( "{$boundary}_post_rel_link", $link ); … … 2814 2814 2815 2815 $link = "<link rel='up' title='"; 2816 2816 $link .= esc_attr( $title ); 2817 $link .= "' href='" . get_ permalink($post) . "' />\n";2817 $link .= "' href='" . get_the_permalink($post) . "' />\n"; 2818 2818 2819 2819 return apply_filters( "parent_post_rel_link", $link ); 2820 2820 } … … 3392 3392 3393 3393 return $size . $unit; 3394 3394 } 3395 3396 /** 3397 * Retrieve full permalink for current post or post ID. 3398 * 3399 * @since 1.0.0 3400 * @deprecated 3.6.0 3401 * @deprecated Use get_the_permalink() 3402 * 3403 * @param int $id Optional. Post ID. 3404 * @param bool $leavename Optional, defaults to false. Whether to keep post name or page name. 3405 * @return string 3406 */ 3407 function get_permalink( $id = 0, $leavename = false ) { 3408 _deprecated_function( __FUNCTION__, '3.6', 'get_the_permalink()' ); 3409 3410 return get_the_permalink( $id, $leavename ); 3411 } 3412 No newline at end of file -
wp-includes/feed.php
188 188 * @uses apply_filters() Call 'the_permalink_rss' on the post permalink 189 189 */ 190 190 function the_permalink_rss() { 191 echo esc_url( apply_filters('the_permalink_rss', get_ permalink() ));191 echo esc_url( apply_filters('the_permalink_rss', get_the_permalink() )); 192 192 } 193 193 194 194 /** -
wp-includes/general-template.php
1055 1055 if ( $results ) { 1056 1056 foreach ( (array) $results as $result ) { 1057 1057 if ( $result->post_date != '0000-00-00 00:00:00' ) { 1058 $url = get_ permalink( $result );1058 $url = get_the_permalink( $result ); 1059 1059 if ( $result->post_title ) 1060 1060 $text = strip_tags( apply_filters( 'the_title', $result->post_title, $result->ID ) ); 1061 1061 else -
wp-includes/link-template.php
13 13 * @uses apply_filters() Calls 'the_permalink' filter on the permalink string. 14 14 */ 15 15 function the_permalink() { 16 echo esc_url( apply_filters( 'the_permalink', get_ permalink() ) );16 echo esc_url( apply_filters( 'the_permalink', get_the_permalink() ) ); 17 17 } 18 18 19 19 /** … … 71 71 /** 72 72 * Retrieve full permalink for current post or post ID. 73 73 * 74 * @param int $id Optional. Post ID. 75 * @param bool $leavename Optional, defaults to false. Whether to keep post name or page name. 76 * @return string 77 */ 78 function get_the_permalink( $id = 0, $leavename = false ) { 79 return get_permalink( $id, $leavename ); 80 } 81 82 /** 83 * Retrieve full permalink for current post or post ID. 84 * 74 85 * @since 1.0.0 75 86 * 76 87 * @param int $id Optional. Post ID. … … 222 233 if ( !empty( $deprecated ) ) 223 234 _deprecated_argument( __FUNCTION__, '1.3' ); 224 235 225 return get_ permalink($post_id);236 return get_the_permalink($post_id); 226 237 } 227 238 228 239 /** … … 307 318 if ( 'page' == $parent->post_type ) 308 319 $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front 309 320 else 310 $parentlink = get_ permalink( $post->post_parent );321 $parentlink = get_the_permalink( $post->post_parent ); 311 322 312 323 if ( is_numeric($post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) 313 324 $name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker … … 475 486 if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') ) 476 487 $url = _get_page_link( $post_id ); 477 488 else 478 $url = get_ permalink($post_id);489 $url = get_the_permalink($post_id); 479 490 480 491 $url = trailingslashit($url) . 'feed'; 481 492 if ( $feed != get_default_feed() ) … … 1231 1242 1232 1243 $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='"; 1233 1244 $link .= esc_attr( $title ); 1234 $link .= "' href='" . get_ permalink($post) . "' />\n";1245 $link .= "' href='" . get_the_permalink($post) . "' />\n"; 1235 1246 1236 1247 $adjacent = $previous ? 'previous' : 'next'; 1237 1248 return apply_filters( "{$adjacent}_post_rel_link", $link ); … … 1393 1404 $date = mysql2date( get_option( 'date_format' ), $post->post_date ); 1394 1405 $rel = $previous ? 'prev' : 'next'; 1395 1406 1396 $string = '<a href="' . get_ permalink( $post ) . '" rel="'.$rel.'">';1407 $string = '<a href="' . get_the_permalink( $post ) . '" rel="'.$rel.'">'; 1397 1408 $inlink = str_replace( '%title', $title, $link ); 1398 1409 $inlink = str_replace( '%date', $date, $inlink ); 1399 1410 $inlink = $string . $inlink . '</a>'; … … 1690 1701 1691 1702 $pagenum = (int) $pagenum; 1692 1703 1693 $result = get_ permalink();1704 $result = get_the_permalink(); 1694 1705 1695 1706 if ( 'newest' == get_option('default_comments_page') ) { 1696 1707 if ( $pagenum != $max_page ) { … … 1823 1834 'add_fragment' => '#comments' 1824 1835 ); 1825 1836 if ( $wp_rewrite->using_permalinks() ) 1826 $defaults['base'] = user_trailingslashit(trailingslashit(get_ permalink()) . 'comment-page-%#%', 'commentpaged');1837 $defaults['base'] = user_trailingslashit(trailingslashit(get_the_permalink()) . 'comment-page-%#%', 'commentpaged'); 1827 1838 1828 1839 $args = wp_parse_args( $args, $defaults ); 1829 1840 $page_links = paginate_links( $args ); … … 2318 2329 if ( !$id = $wp_the_query->get_queried_object_id() ) 2319 2330 return; 2320 2331 2321 $link = get_ permalink( $id );2332 $link = get_the_permalink( $id ); 2322 2333 2323 2334 if ( $page = get_query_var('cpage') ) 2324 2335 $link = get_comments_pagenum_link( $page ); -
wp-includes/ms-functions.php
311 311 */ 312 312 function get_blog_permalink( $blog_id, $post_id ) { 313 313 switch_to_blog( $blog_id ); 314 $link = get_ permalink( $post_id );314 $link = get_the_permalink( $post_id ); 315 315 restore_current_blog(); 316 316 317 317 return $link; -
wp-includes/nav-menu.php
594 594 $menu_item->_invalid = true; 595 595 } 596 596 597 $menu_item->url = get_ permalink( $menu_item->object_id );597 $menu_item->url = get_the_permalink( $menu_item->object_id ); 598 598 599 599 $original_object = get_post( $menu_item->object_id ); 600 600 $original_title = $original_object->post_title; … … 643 643 $menu_item->type_label = $object->labels->singular_name; 644 644 645 645 $menu_item->title = $menu_item->post_title; 646 $menu_item->url = get_ permalink( $menu_item->ID );646 $menu_item->url = get_the_permalink( $menu_item->ID ); 647 647 $menu_item->target = ''; 648 648 649 649 $menu_item->attr_title = apply_filters( 'nav_menu_attr_title', '' ); -
wp-includes/pluggable.php
1045 1045 /* translators: 1: blog name, 2: post title */ 1046 1046 $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title ); 1047 1047 } 1048 $notify_message .= get_ permalink($comment->comment_post_ID) . "#comments\r\n\r\n";1049 $notify_message .= sprintf( __('Permalink: %s'), get_ permalink( $comment->comment_post_ID ) . '#comment-' . $comment_id ) . "\r\n";1048 $notify_message .= get_the_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 1049 $notify_message .= sprintf( __('Permalink: %s'), get_the_permalink( $comment->comment_post_ID ) . '#comment-' . $comment_id ) . "\r\n"; 1050 1050 if ( EMPTY_TRASH_DAYS ) 1051 1051 $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n"; 1052 1052 else … … 1116 1116 { 1117 1117 case 'trackback': 1118 1118 $notify_message = sprintf( __('A new trackback on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n"; 1119 $notify_message .= get_ permalink($comment->comment_post_ID) . "\r\n\r\n";1119 $notify_message .= get_the_permalink($comment->comment_post_ID) . "\r\n\r\n"; 1120 1120 $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 1121 1121 $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; 1122 1122 $notify_message .= __('Trackback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 1123 1123 break; 1124 1124 case 'pingback': 1125 1125 $notify_message = sprintf( __('A new pingback on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n"; 1126 $notify_message .= get_ permalink($comment->comment_post_ID) . "\r\n\r\n";1126 $notify_message .= get_the_permalink($comment->comment_post_ID) . "\r\n\r\n"; 1127 1127 $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 1128 1128 $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; 1129 1129 $notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 1130 1130 break; 1131 1131 default: //Comments 1132 1132 $notify_message = sprintf( __('A new comment on the post "%s" is waiting for your approval'), $post->post_title ) . "\r\n"; 1133 $notify_message .= get_ permalink($comment->comment_post_ID) . "\r\n\r\n";1133 $notify_message .= get_the_permalink($comment->comment_post_ID) . "\r\n\r\n"; 1134 1134 $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 1135 1135 $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n"; 1136 1136 $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; -
wp-includes/post-formats.php
907 907 $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1]; 908 908 } else { 909 909 if ( ! empty( $more_link_text ) ) 910 $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_ permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );910 $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_the_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text ); 911 911 912 912 $output = force_balance_tags( $output ); 913 } 914 } 913 } } 915 914 916 915 if ( $preview ) // preview fix for javascript bug with foreign languages 917 916 $output = preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output ); -
wp-includes/post-template.php
220 220 $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1]; 221 221 } else { 222 222 if ( ! empty( $more_link_text ) ) 223 $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_ permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );223 $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_the_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text ); 224 224 $output = force_balance_tags( $output ); 225 225 } 226 226 } … … 706 706 $post = get_post(); 707 707 708 708 if ( 1 == $i ) { 709 $url = get_ permalink();709 $url = get_the_permalink(); 710 710 } else { 711 711 if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) 712 $url = add_query_arg( 'page', $i, get_ permalink() );712 $url = add_query_arg( 'page', $i, get_the_permalink() ); 713 713 elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID ) 714 $url = trailingslashit(get_ permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged');714 $url = trailingslashit(get_the_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged'); 715 715 else 716 $url = trailingslashit(get_ permalink()) . user_trailingslashit($i, 'single_paged');716 $url = trailingslashit(get_the_permalink()) . user_trailingslashit($i, 'single_paged'); 717 717 } 718 718 719 719 return '<a href="' . esc_url( $url ) . '">'; … … 1058 1058 1059 1059 $css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); 1060 1060 1061 $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_ permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';1061 $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_the_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>'; 1062 1062 1063 1063 if ( !empty($show_date) ) { 1064 1064 if ( 'modified' == $show_date ) -
wp-includes/post.php
2845 2845 2846 2846 // Set GUID 2847 2847 if ( !$update && '' == $current_guid ) 2848 $wpdb->update( $wpdb->posts, array( 'guid' => get_ permalink( $post_ID ) ), $where );2848 $wpdb->update( $wpdb->posts, array( 'guid' => get_the_permalink( $post_ID ) ), $where ); 2849 2849 2850 2850 clean_post_cache( $post_ID ); 2851 2851 … … 4757 4757 if ( $old_status != 'publish' && $new_status == 'publish' ) { 4758 4758 // Reset GUID if transitioning to publish and it is empty 4759 4759 if ( '' == get_the_guid($post->ID) ) 4760 $wpdb->update( $wpdb->posts, array( 'guid' => get_ permalink( $post->ID ) ), array( 'ID' => $post->ID ) );4760 $wpdb->update( $wpdb->posts, array( 'guid' => get_the_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); 4761 4761 do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish 4762 4762 } 4763 4763 -
wp-includes/query.php
3612 3612 if ( ! $id ) 3613 3613 return; 3614 3614 3615 $link = get_ permalink($id);3615 $link = get_the_permalink($id); 3616 3616 3617 3617 if ( !$link ) 3618 3618 return; -
wp-includes/theme-compat/comments-popup.php
68 68 69 69 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 70 70 <?php if ( $user_ID ) : ?> 71 <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out »</a>'), get_edit_user_link(), $user_identity, wp_logout_url(get_ permalink())); ?></p>71 <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out »</a>'), get_edit_user_link(), $user_identity, wp_logout_url(get_the_permalink())); ?></p> 72 72 <?php else : ?> 73 73 <p> 74 74 <input type="text" name="author" id="author" class="textarea" value="<?php echo esc_attr($comment_author); ?>" size="28" tabindex="1" /> -
wp-includes/theme-compat/comments.php
62 62 </div> 63 63 64 64 <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> 65 <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_ permalink() )); ?></p>65 <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_the_permalink() )); ?></p> 66 66 <?php else : ?> 67 67 68 68 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 69 69 70 70 <?php if ( is_user_logged_in() ) : ?> 71 71 72 <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_edit_user_link(), $user_identity); ?> <a href="<?php echo wp_logout_url(get_ permalink()); ?>" title="<?php esc_attr_e('Log out of this account'); ?>"><?php _e('Log out »'); ?></a></p>72 <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_edit_user_link(), $user_identity); ?> <a href="<?php echo wp_logout_url(get_the_permalink()); ?>" title="<?php esc_attr_e('Log out of this account'); ?>"><?php _e('Log out »'); ?></a></p> 73 73 74 74 <?php else : ?> 75 75 -
wp-trackback.php
77 77 78 78 if (empty($title) && empty($tb_url) && empty($blog_name)) { 79 79 // If it doesn't look like a trackback at all... 80 wp_redirect(get_ permalink($tb_id));80 wp_redirect(get_the_permalink($tb_id)); 81 81 exit; 82 82 } 83 83