Revert [5275] - [5277]. Fix it later. see #4153

git-svn-id: https://develop.svn.wordpress.org/trunk@5282 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-04-17 23:00:35 +00:00
parent 767e7aa881
commit b749fb0711
1 changed files with 21 additions and 32 deletions

View File

@ -274,50 +274,39 @@ function get_post_comments_feed_link($post_id = '', $feed = 'rss2') {
return apply_filters('post_comments_feed_link', $url); return apply_filters('post_comments_feed_link', $url);
} }
function get_edit_post_link( $link = 'Edit This' ) { function edit_post_link($link = 'Edit This', $before = '', $after = '') {
global $post; global $post;
if ( is_attachment() ) { if ( is_attachment() )
return; return;
}
if ( $post->post_type == 'page' ) { if( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) ) { if ( ! current_user_can('edit_page', $post->ID) )
return; return;
}
$file = 'page'; $file = 'page';
} else { } else {
if ( !current_user_can( 'edit_post', $post->ID ) ) { if ( ! current_user_can('edit_post', $post->ID) )
return; return;
}
$file = 'post'; $file = 'post';
} }
return '<a href="' . get_option( 'wpurl' ) . '/wp-admin/' . $file . '.php?action=edit&amp;post=' . $post->ID . '>' . $link . '</a>' . $after; $location = get_option('siteurl') . "/wp-admin/{$file}.php?action=edit&amp;post=$post->ID";
echo $before . "<a href=\"$location\">$link</a>" . $after;
} }
function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
echo $before . get_edit_post_link( $link ) . $after;
}
function get_edit_comment_link( $link = 'Edit This' ) {
global $post, $comment; global $post, $comment;
if ( $post->post_type == 'page' ) { if( $post->post_type == 'page' ){
if ( !current_user_can( 'edit_page', $post->ID ) ) { if ( ! current_user_can('edit_page', $post->ID) )
return; return;
}
} else { } else {
if ( !current_user_can( 'edit_post', $post->ID ) ) { if ( ! current_user_can('edit_post', $post->ID) )
return; return;
}
} }
return '<a href="' . get_option( 'siteurl' ) . '/wp-admin/comment.php?action=editcomment&amp;c=' . $comment->comment_ID . '">' . $link . '</a>'; $location = get_option('siteurl') . "/wp-admin/comment.php?action=editcomment&amp;c=$comment->comment_ID";
} echo $before . "<a href='$location'>$link</a>" . $after;
function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) {
echo $before . get_edit_comment_link( $link ) . $after;
} }
// Navigation links // Navigation links