Start typing to search...

The do_not_force Filter

The do_not_force filter lets you choose to redirect to a download instead of serving it via PHP. This is useful for large files which cannot be downloaded reliably.

You can turn off download forcing via a function in your theme’s functions.php. So for example, if your download ID was 25 you could use:

PHP
add_filter( 'dlm_do_not_force', 'do_not_force_by_id' );

<strong>function</strong> <strong>do_not_force_by_id</strong>( $do_not_force, $download ) {
	<strong>if</strong> ( '25' == $download->id ) {
		<strong>return</strong> <strong>true</strong>;
	}

	<strong>return</strong> $do_not_force;
}

To not force all downloads it’s easier:

PHP
add_filter( 'dlm_do_not_force', '__return_true' );

Was this page helpful?
1 0
Start Protecting your WordPress Downloads

Protect and track downloads on WordPress... What are you waiting for?