Skip to content
Docs
Get RestroPress

Filter

rpress_importer_can_trash

Updated
On this page

Filters whether the importer may move menu items to the trash.

Defaults to true when EMPTY_TRASH_DAYS is not 0. Replace mode depends on undo restoring trashed menu items, so it is refused when this returns false. Returning true while the trash is disabled would delete replaced items permanently.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$can_trashboolWhether trashing is allowed.

Return value#

bool. Whether trashing is allowed.

Example#

add_filter( 'rpress_importer_can_trash', 'my_importer_can_trash', 10, 1 );
function my_importer_can_trash( $can_trash ) {
	return false;
}

Source#

Applied in:

  • includes/features/importer/class-rpress-importer-engine.php (line 536), in RPress_Importer_Engine::can_trash()
Was this page helpful?