WordPress.org

Make WordPress Core

Ticket #6168: 6168.diff

File 6168.diff, 1.3 KB (added by mdawaffe, 13 years ago)
  • wp-includes/link-template.php

     
    441441function get_edit_post_link( $id = 0 ) {
    442442        $post = &get_post( $id );
    443443
    444         if ( $post->post_type == 'attachment' ) {
    445                 return;
    446         } elseif ( $post->post_type == 'page' ) {
     444        if ( $post->post_type == 'page' ) {
    447445                if ( !current_user_can( 'edit_page', $post->ID ) )
    448446                        return;
    449447
     
    461459function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
    462460        global $post;
    463461
    464         if ( $post->post_type == 'attachment' ) {
    465                 return;
    466         } elseif ( $post->post_type == 'page' ) {
     462        if ( $post->post_type == 'page' ) {
    467463                if ( !current_user_can( 'edit_page', $post->ID ) )
    468464                        return;
    469465
     
    483479        $comment = &get_comment( $comment_id );
    484480        $post = &get_post( $comment->comment_post_ID );
    485481
    486         if ( $post->post_type == 'attachment' ) {
    487                 return;
    488         } elseif ( $post->post_type == 'page' ) {
     482        if ( $post->post_type == 'page' ) {
    489483                if ( !current_user_can( 'edit_page', $post->ID ) )
    490484                        return;
    491485        } else {
     
    501495        global $comment, $post;
    502496
    503497        if ( $post->post_type == 'attachment' ) {
    504                 return;
    505498        } elseif ( $post->post_type == 'page' ) {
    506499                if ( !current_user_can( 'edit_page', $post->ID ) )
    507500                        return;