Automattic\WooCommerce\Admin\Notes\MerchantEmailNotifications
MerchantEmailNotifications::get_notification_email_addresses() public WC 1.0
Get email addresses by role to notify.
{} Это метод класса: MerchantEmailNotifications{}
Хуков нет.
Возвращает
Массив. Emails to notify
Использование
$result = MerchantEmailNotifications::get_notification_email_addresses( $note );
- $note(объект) (обязательный)
- The note to send.
Код MerchantEmailNotifications::get_notification_email_addresses() MerchantEmailNotifications::get notification email addresses WC 5.0.0
public static function get_notification_email_addresses( $note ) {
$content_data = $note->get_content_data();
$role = 'administrator';
if ( isset( $content_data->role ) ) {
$role = $content_data->role;
}
$args = array( 'role' => $role );
$users = get_users( $args );
return array_column( $users, 'user_email' );
}