Hi there @glouton, could you try adding the priority and accepted_args parameters to the add_filter
function, like so:
add_filter(
'edit_post_link',
function( $link, $post_id, $text ) {
$post = get_post($post_id);
$slug = $post->post_name;
if ( 'my-slug' === $slug ) {
return '';
}
return $link;
},
10,
3
);
The default value for the accepted_args
is 1, but your closure is expecting 3, therefore apply_filters
only sends the first argument over, resulting in the error.
Let me know how this goes!
Thanks, Thomas.