Skip to main content
edited body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . esc_url( build_query( $args ) ); return $url;esc_url( $url ); } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . esc_url( build_query( $args ) ); return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . build_query( $args ); return esc_url( $url ); } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

added 35 characters in body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . buld_queryesc_url( build_query( $args ) ); return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . buld_query( $args ); return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . esc_url( build_query( $args ) ); return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

added 35 characters in body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= esc_url( '?subject=hello&body=world'' );. //buld_query( <--$args Adjust);  to your needs!   return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= esc_url( '?subject=hello&body=world' ); // <-- Adjust to your needs!  return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

This is how the email part is displayed by the WP_Comments_List::column_author() method:

/* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ! empty( $email ) && '@' !== $email ) { printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) ); } 

so you're most likely looking for the comment_email filter.

Update:

Here's a hack to add a subject and body to the mailto part:

add_filter( 'comment_email', function( $email ) { // Target the edit-comments.php screen if( did_action( 'load-edit-comments.php' ) ) add_filter( 'clean_url', 'wpse_258903_append_subject_and_body' ); return $email; } ); function wpse_258903_append_subject_and_body( $url ) { // Only run once remove_filter( current_filter(), __FUNCTION__ ); // Adjust to your needs: $args = [ 'subject' => 'hello', 'body' => 'world' ]; // Only append to a mailto url if( 'mailto' === wp_parse_url($url, PHP_URL_SCHEME ) ) $url .= '?' . buld_query( $args );    return $url; } 

Note that this targets the first esc_url() after each time the comment_email filter is applied, on the edit-comments.php page.

We added a mailto check to make sure it's for the email part.

added 35 characters in body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255
Loading
added 877 characters in body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255
Loading
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255
Loading