Automattic\WooCommerce\Admin\RemoteInboxNotifications

SpecRunner::get_actions()public staticWC 1.0

Get the actions for a note.

Method of the class: SpecRunner{}

No Hooks.

Return

Array. The actions.

Usage

$result = SpecRunner::get_actions( $spec );
$spec(object) (required)
The spec.

SpecRunner::get_actions() code WC 8.7.0

public static function get_actions( $spec ) {
	$note    = new Note();
	$actions = isset( $spec->actions ) ? $spec->actions : array();
	foreach ( $actions as $action ) {
		$action_locale = self::get_action_locale( $action->locales );

		$url = self::get_url( $action );

		$note->add_action(
			$action->name,
			( $action_locale === null || ! isset( $action_locale->label ) )
				? ''
				: $action_locale->label,
			$url,
			$action->status
		);
	}
	return $note->get_actions();
}