Filter hook 'edit_post_link'

in WP Core File wp-includes/link-template.php at line 1542

View Source

edit_post_link

Filter Hook
Description
Filters the post edit link anchor tag.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 1542

Hook Parameters

Type Name Description
string $link Anchor tag for the edit link.
int $post_id Post ID.
string $text Anchor text.

Usage Examples

Basic Usage
<?php
// Hook into edit_post_link
add_filter('edit_post_link', 'my_custom_filter', 10, 3);

function my_custom_filter($link, $post_id, $text) {
    // Your custom filtering logic here
    return $link;
}

Source Code Context

wp-includes/link-template.php:1542 - How this hook is used in WordPress core
<?php
1537  	 *
1538  	 * @param string $link    Anchor tag for the edit link.
1539  	 * @param int    $post_id Post ID.
1540  	 * @param string $text    Anchor text.
1541  	 */
1542  	echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;
1543  }
1544  
1545  /**
1546   * Retrieves the delete posts link for post.
1547   *

PHP Documentation

<?php
/**
	 * Filters the post edit link anchor tag.
	 *
	 * @since 2.3.0
	 *
	 * @param string $link    Anchor tag for the edit link.
	 * @param int    $post_id Post ID.
	 * @param string $text    Anchor text.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.