Automattic\WooCommerce\Admin\Notes

Note::get_action()publicWC 1.0

Get action by action name on the note.

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

Хуков нет.

Возвращает

Объект. the action.

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

$Note = new Note();
$Note->get_action( $action_name, $context );
$action_name(строка) (обязательный)
The action name.
$context(строка)
What the value is for. Valid values are 'view' and 'edit'.
По умолчанию: 'view'

Код Note::get_action() WC 8.7.0

public function get_action( $action_name, $context = 'view' ) {
	$actions = $this->get_prop( 'actions', $context );

	$matching_action = null;
	foreach ( $actions as $i => $action ) {
		if ( $action->name === $action_name ) {
			$matching_action =& $actions[ $i ];
			break;
		}
	}
	return $matching_action;
}