bbp_get_trash_days( string $context = 'forum' )

Get number of days something should remain trashed for before it is cleaned up by WordPress Cron. If set to 0, items will skip trash and be deleted immediately.


Description Description


Parameters Parameters

$context

(Optional) Provide context for additional filtering

Default value: 'forum'


Top ↑

Return Return

(int) Number of days items remain in trash


Top ↑

Source Source

File: includes/common/functions.php

function bbp_get_trash_days( $context = 'forum' ) {

	// Sanitize the context
	$context = sanitize_key( $context );

	// Check the WordPress constant
	$days    = defined( 'EMPTY_TRASH_DAYS' )
		? (int) EMPTY_TRASH_DAYS
		: 30;

	// Filter & return
	return (int) apply_filters( 'bbp_get_trash_days', $days, $context );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.