Automattic\WooCommerce\Internal\Admin\Notes
MerchantEmailNotifications::get_notification_recipients()
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() MerchantEmailNotifications::get notification recipients WC 9.7.1
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 ); }