Skip to content
Docs
Get RestroPress

Filter

rpress_reset_item_type

Updated
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#

ParameterTypeDescription
$item_typestringGroup name for the item. Default is other.
$itemarrayThe 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), in RPRESS_Tools_Reset_Stats::get_data()

See also#

Was this page helpful?