PDA_Hooks

Helper class to define the hooks existing in the Prevent Direct Access Gold plugin.

Class PDA_Hooks

package

pda_hooks

Methods

Constants

Action before sending file to client.

PDA_HOOK_BEFORE_SENDING_FILE

Code example: https://gist.github.com/bwps/5c5d75072ad7d76aa102bf193d31477c

Params:

'user_id' => (integer) The current user's id accessing the link

'link_id' => (integer) The attachment id

'link_type' => (string) private_link or original_link

'mime_type' => (string) The mime type

'file' => (string) The absolute file path

);

Action after protect attachment file.

PDA_HOOK_AFTER_PROTECT_FILE

Code example: https://gist.github.com/bwps/0fef96af80529112119b25247dccef7e

Params:

  • int $post_id The attachment file's ID

Action after un-protect attachment file.

PDA_HOOK_AFTER_UN_PROTECT_FILE

Code example: https://gist.github.com/bwps/d27bc01f86198d954129f0cb7724f762

Params:

  • int $post_id The attachment file's ID

Action after protect attachment file when file uploads

PDA_HOOK_AFTER_PROTECT_FILE_WHEN_UPLOAD

Code example: https://gist.github.com/bwps/41a292743181ef59d087deb9b1cd5e55

Params:

  • int $post_id The attachment file's ID

Action before protecting file

PDA_HOOK_BEFORE_PROTECT_FILE

Code example: https://gist.github.com/gaupoit/503bd20303e2a81aec670064465947f1

Params:

  • int $post_id The attachment file's ID