Automattic\WooCommerce\Internal\Admin\Orders
ListTable::single_row()
Generates content for a single row of the table.
Метод класса: ListTable{}
Хуки из метода
Возвращает
null
. Ничего (null).
Использование
$ListTable = new ListTable(); $ListTable->single_row( $order );
- $order(\WC_Order) (обязательный)
- The current order.
Список изменений
С версии 7.8.0 | Введена. |
Код ListTable::single_row() ListTable::single row WC 9.2.3
public function single_row( $order ) { /** * Filters the list of CSS class names for a given order row in the orders list table. * * @since 7.8.0 * * @param string[] $classes An array of CSS class names. * @param \WC_Order $order The order object. */ $css_classes = apply_filters( 'woocommerce_' . $this->order_type . '_list_table_order_css_classes', array( 'order-' . $order->get_id(), 'type-' . $order->get_type(), 'status-' . $order->get_status(), ), $order ); $css_classes = array_unique( array_map( 'trim', $css_classes ) ); // Is locked? $edit_lock = wc_get_container()->get( EditLock::class ); if ( $edit_lock->is_locked_by_another_user( $order ) ) { $css_classes[] = 'wp-locked'; } echo '<tr id="order-' . esc_attr( $order->get_id() ) . '" class="' . esc_attr( implode( ' ', $css_classes ) ) . '">'; $this->single_row_columns( $order ); echo '</tr>'; }