Automattic\WooCommerce\Admin\Notes
Notes::get_action_by_id() public WC 1.0
Get action by id.
{} Это метод класса: Notes{}
Хуков нет.
Возвращает
Объект/true/false. The found action.
Использование
$result = Notes::get_action_by_id( $note, $action_id );
- $note(Note) (обязательный)
- The note that has of the action.
- $action_id(число) (обязательный)
- Action ID.
Код Notes::get_action_by_id() Notes::get action by id WC 5.0.0
public static function get_action_by_id( $note, $action_id ) {
$actions = $note->get_actions( 'edit' );
$found_action = false;
foreach ( $actions as $action ) {
if ( $action->id === $action_id ) {
$found_action = $action;
}
}
return $found_action;
}