Filter
rpress_reset_item_type
On this page
Filters the group a non-standard item belongs to during a data reset.
Runs in the Reset Restaurant Data tool for every stored item that is neither a customer nor a menu item. The default group is other, which deletes the post, its meta and its comments. Return a custom group name to handle the item with queries added through rpress_reset_add_queries_{$type}.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$item_type | string | Group name for the item. Default is other. |
$item | array | The item being reset, with id (int) and type (the post type string) keys. |
Return value#
string. The group name for the item.
Example#
function my_reset_item_type( $item_type, $item ) {
if ( 'my_custom_log' === $item['type'] ) {
return 'my_custom_log';
}
return $item_type;
}
add_filter( 'rpress_reset_item_type', 'my_reset_item_type', 10, 2 );
Source#
Applied in:
includes/admin/tools/class-rpress-tools-reset-stats.php(line 70), inRPRESS_Tools_Reset_Stats::get_data()
See also#
rpress_reset_add_queries_%7B%24type%7Drpress_reset_store_items
Was this page helpful?
