Filter
rpress_reset_store_items
On this page
Filters the list of items removed by the Reset Restaurant Data tool.
Runs once the posts and customers to reset have been collected. Each item is an array with an id and a type; customers use the type customer and posts use their post type. Add or remove items here to change what the reset touches.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$items | array | List of items, each an array with id (int) and type (string) keys. |
Return value#
array. The modified list of items.
Example#
function my_reset_store_items( $items ) {
return array_values( array_filter( $items, function ( $item ) {
return 'rpress_discount' !== $item['type'];
} ) );
}
add_filter( 'rpress_reset_store_items', 'my_reset_store_items' );
Notes#
This tool deletes data. Test any change on a staging site.
Source#
Applied in:
includes/admin/tools/class-rpress-tools-reset-stats.php(line 255), inRPRESS_Tools_Reset_Stats::pre_fetch()
See also#
Was this page helpful?
