From b749fb0711c82ba942e8ddef7145b4df6509cc7f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 17 Apr 2007 23:00:35 +0000 Subject: [PATCH] Revert [5275] - [5277]. Fix it later. see #4153 git-svn-id: https://develop.svn.wordpress.org/trunk@5282 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 53 ++++++++++++++--------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 291a1c6245..f41b7224b1 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -274,50 +274,39 @@ function get_post_comments_feed_link($post_id = '', $feed = 'rss2') { 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; - - if ( is_attachment() ) { + + if ( is_attachment() ) return; - } - - if ( $post->post_type == 'page' ) { - if ( !current_user_can( 'edit_page', $post->ID ) ) { + + if( $post->post_type == 'page' ) { + if ( ! current_user_can('edit_page', $post->ID) ) return; - } $file = 'page'; } else { - if ( !current_user_can( 'edit_post', $post->ID ) ) { + if ( ! current_user_can('edit_post', $post->ID) ) return; - } $file = 'post'; } - - return 'ID"; + echo $before . "$link" . $after; } -function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { - echo $before . get_edit_post_link( $link ) . $after; -} - -function get_edit_comment_link( $link = 'Edit This' ) { +function edit_comment_link($link = 'Edit This', $before = '', $after = '') { global $post, $comment; - - if ( $post->post_type == 'page' ) { - if ( !current_user_can( 'edit_page', $post->ID ) ) { - return; - } - } else { - if ( !current_user_can( 'edit_post', $post->ID ) ) { - return; - } - } - - return '' . $link . ''; -} -function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { - echo $before . get_edit_comment_link( $link ) . $after; + if( $post->post_type == 'page' ){ + if ( ! current_user_can('edit_page', $post->ID) ) + return; + } else { + if ( ! current_user_can('edit_post', $post->ID) ) + return; + } + + $location = get_option('siteurl') . "/wp-admin/comment.php?action=editcomment&c=$comment->comment_ID"; + echo $before . "$link" . $after; } // Navigation links