Recent Topics

1 Oct 08, 2016 15:30    

Could you please also considering adding hooks for downloads. This will be for when ever a front end user clicks to download a file. Such as:

	/* 
	*	Used by plugin that can request user to be logged in to download file
	*	Or check if user is human
	*	Or request password
	*	Get requested file ID and perhaps the plugin will only allow a specific user to download
	*	Or allow downloads for specified blog, user level ect
	*	if $canceldownload = true it will stop the download process
	*	if $canceldownload = true user can be redirected to custom url
	*/
	function BeforeDownloadAction( $canceldownload = false, $redirect_url = 'none' )
	{
	
	return true;
	}

	/* 
	*	Used by plugin that can redirect user after file download
	* 	Or display a custom message that can be targeted by user level ect
	*	User can be redirected to custom url
	*/
	function AfterDownloadAction( $redirect_url = 'none' )
	{
	
	return true;
	}

2 Oct 08, 2016 15:45

@fplanque wrote earlier:

Would that work as new events:

Thanks, WidgetsBeginSettingsForm() and WidgetsEndSettingsForm() will be perfect. Thanks!

4 Oct 19, 2016 08:24

Is the dev team considering adding the download hooks?

5 Oct 19, 2016 15:39

Yes, they should already be in 6.7.8 on GitHub.

6 Oct 19, 2016 16:43

WidgetBegin and WidgetEndSettingsForm are on GitHub, but BeforeDownloadAction and AfterDownloadAction are not?

7 Oct 19, 2016 22:24

Ah see, that's what happens when you mix different requests in a single forum topic! :p


I don't understand how these hooks are supposed to work.

Can you please post a screenshot with arrows showing exactly when and where you expect those events to fire? (ideally in a similar way to the screenshot above) And give one (just one) example of what a plugin might do when the event fires?

Thanks.


Form is loading...