Automattic\WooCommerce\Internal\Admin\Notes

MerchantEmailNotifications::get_notification_recipients()public staticWC 1.0

Get users by role to notify.

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

No Hooks.

Return

Array. Users to notify

Usage

$result = MerchantEmailNotifications::get_notification_recipients( $note );
$note(object) (required)
The note to send.

Code of MerchantEmailNotifications::get_notification_recipients() WC 7.1.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 );
}