Automattic\WooCommerce\Admin\RemoteInboxNotifications
SpecRunner::get_actions
Get the actions for a note.
Method of the class: SpecRunner{}
No Hooks.
Returns
Array. The actions.
Usage
$result = SpecRunner::get_actions( $spec );
- $spec(object) (required)
- The spec.
SpecRunner::get_actions() SpecRunner::get actions code WC 10.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();
}