Automattic\WooCommerce\Internal\Admin\Orders
ListTable::single_row
Generates content for a single row of the table.
Method of the class: ListTable{}
Hooks from the method
Returns
null
. Nothing (null).
Usage
$ListTable = new ListTable(); $ListTable->single_row( $order );
- $order(WC_Order) (required)
- The current order.
Changelog
Since 7.8.0 | Introduced. |
ListTable::single_row() ListTable::single row code WC 9.9.5
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>'; }