wp_mail_embed_args
Filters the arguments for PHPMailer's addEmbeddedImage() method.
Использование
add_filter( 'wp_mail_embed_args', 'wp_kama_mail_embed_args_filter' );
/**
* Function for `wp_mail_embed_args` filter-hook.
*
* @param array $args An array of arguments for `addEmbeddedImage()`.
*
* @return array
*/
function wp_kama_mail_embed_args_filter( $args ){
// filter...
return $args;
}
- $args(массив)
An array of arguments for addEmbeddedImage().
-
path(строка)
The path to the file. -
cid(строка)
The Content-ID of the image.
По умолчанию: The key in the embeds array -
name(строка)
The filename of the image. -
encoding(строка)
The encoding of the image.
По умолчанию: 'base64' -
type(строка)
The MIME type of the image.
По умолчанию: empty string, which lets PHPMailer auto-detect - disposition(строка)
The disposition of the image.
По умолчанию: 'inline'
-
Список изменений
| С версии 6.9.0 | Введена. |
Где вызывается хук
wp_mail_embed_args
wp-includes/pluggable.php 585-595
$embed_args = apply_filters( 'wp_mail_embed_args', array( 'path' => $embed_path, 'cid' => (string) $key, 'name' => basename( $embed_path ), 'encoding' => 'base64', 'type' => '', 'disposition' => 'inline', ) );