WordPress.org

Make WordPress Core

Ticket #44017: patch.diff

File patch.diff, 477 bytes (added by rafsuntaskin, 3 years ago)

'can_view_edit_post_link' filter added

  • wp-includes/link-template.php

    diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
    index 815c539..bae6ed9 100644
    a b function get_edit_post_link( $id = 0, $context = 'display' ) { 
    13501350                return;
    13511351        }
    13521352
    1353         if ( ! current_user_can( 'edit_post', $post->ID ) ) {
     1353        if ( ! ( current_user_can( 'edit_post', $post->ID ) || apply_filters( 'can_view_edit_post_link', false , $post->ID ) ) ) {
    13541354                return;
    13551355        }
    13561356