WordPress.org

Ready to get started?Download WordPress

Forums

How to modify function edit_comment_link? (2 posts)

  1. s0what
    Member
    Posted 4 years ago #

    Hi!

    I need to modify function edit_comment_link to make it do following:

    function edit_comment_link( $link = null, $before = '', $after = '' ) {
    	global $comment, $post;
    
    		if ( !current_user_can( 'edit_own_comments' ) )
    			return;
    
    	if ( null === $link )
    		$link = __('Edit This');
    
    	$link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
    	echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
    }

    Is there a way to do it with plugins or I have to do it manually after every upgrade?

  2. s0what
    Member
    Posted 4 years ago #

    I found a solution - I made similar function and put it in theme functions.php file :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.