Multisite hooks
This page lists the 3 hooks of this group. Each entry shows its type, the version it arrived in, where it runs, its arguments and a starting point.
adba_network_index_row
FilterSince 2.2.0 Runs in src/Network/Indexer.php.
Filters a row of the network index before it is written (multisite).
Return null to keep the object out of the index. Columns: number, title, status, total, currency, date_created (GMT, Y-m-d H:i:s), email, subtype, stock, stock_qty, image, customer_id.
| Argument | Type | Description |
|---|---|---|
$row | array<string, mixed>|null | Row, null when Addofy does not index this object. |
$object | object|null | The order or product, null for a type of your own. |
$type | string | Type. |
$id | int | Object id. |
add_filter( 'adba_network_index_row', function ( $row, $object, $type, $id ) {
return $row;
}, 10, 4 );
adba_network_index_types
FilterSince 2.2.0 Runs in src/Network/Indexer.php.
Filters the object types kept in the network index (multisite).
Built in: order and product. Remove one to stop indexing it. For a type of your own, queue objects with \AddoBack\Network\Indexer::queue( $type, $id ) and build their row in adba_network_index_row (the object is null then).
| Argument | Type | Description |
|---|---|---|
$types | string[] | Type names. |
add_filter( 'adba_network_index_types', function ( $types ) {
return $types;
} );
adba_network_list_columns
FilterSince 2.2.0 Runs in src/Modules/NetworkLists/NetworkTable.php.
Filters the columns of the network overview lists (All orders, All products).
Fill a column of your own through the column_{name} method of a subclass, or keep to the index columns.
| Argument | Type | Description |
|---|---|---|
$columns | array<string, string> | Column id => label. |
$type | string | order or product. |
add_filter( 'adba_network_list_columns', function ( $columns, $type ) {
return $columns;
}, 10, 2 );