Automattic\WooCommerce\Internal\Admin\Notes

MerchantEmailNotifications::get_notification_recipients()public staticWC 1.0

Get users by role to notify.

Метод класса: MerchantEmailNotifications{}

Хуков нет.

Возвращает

Массив. Users to notify

Использование

$result = MerchantEmailNotifications::get_notification_recipients( $note );
$note(объект) (обязательный)
The note to send.

Код MerchantEmailNotifications::get_notification_recipients() WC 8.7.0

public static function get_notification_recipients( $note ) {
	$content_data = $note->get_content_data();
	$role         = 'administrator';
	if ( isset( $content_data->role ) ) {
		$role = $content_data->role;
	}
	$args = array( 'role' => $role );
	return get_users( $args );
}