WP File Download Developer Documentation

This documentation will help experienced developers to plug any other service with our plugin. Here are all actions and filters for this plugin, if you need some more, feel free to ask by using this for dedicated forum. Thanks for using our plugin!

wpfd_after_category_main_settings

Action fire after category main settings in right panel

Parameters :

integer Current category id

Return :

void

In files :

/app/admin/views/category/tpl/default.php line 154

wpfd_after_create_new_category

Action after new category created

Parameters :

integer New category id
string Category created name

Return :

void

In files :

/app/admin/controllers/category.php line 65

wpfd_after_fieldset_category_main_settings

Action fire after category main settings fieldset in right panel

Parameters :

integer Current category id

Return :

void

In files :

/app/admin/views/category/tpl/default.php line 163

wpfd_after_file_main_settings

Action thrown after all file settings inputs have been echoed

Parameters :

string Curent file informations

Return :

void

In files :

/app/admin/forms/file.xml line 166

wpfd_after_single_file_info

Action fire after file info in single file display

Parameters :

object File object

Return :

void

In files :

/app/site/themes/templates/tpl-single.php line 49

wpfd_after_template_part

Action fire after a template part called

Parameters :

string Template name
string Template path dir
string Template path
array Template variables

Return :

void

In files :

/app/functions.php line 643

wpfd_before_category_main_settings

Action fire before category main settings in right panel

Parameters :

integer Current category id

Return :

void

In files :

/app/admin/views/category/tpl/default.php line 63

wpfd_before_fieldset_category_main_settings

Action fire before category main settings field set in right panel

Parameters :

integer Current category id

Return :

void

In files :

/app/admin/views/category/tpl/default.php line 53

wpfd_before_single_file_info

Action fire before file info in single file display

Parameters :

object File object

Return :

void

In files :

/app/site/themes/templates/tpl-single.php line 33

wpfd_before_template_part

Action fire before a template part called

Parameters :

string Template name
string Template path dir
string Template path
array Template variables

Return :

void

In files :

/app/functions.php line 631

wpfd_file_deleted

Action fire after a file deleted

Parameters :

array Deleted file info
WP_Term Category the file was deleted from
array Additional information

Return :

void

In files :

/app/admin/controllers/file.php line 447
/app/admin/controllers/file.php line 506

wpfd_file_download

Action fire right before a file download.
Do not echo anything here or file download will corrupt

Parameters :

object File id
array Source

Return :

void

In files :

/app/site/controllers/file.php line 183
/app/site/controllers/file.php line 244
/app/site/controllers/file.php line 287
/app/site/controllers/file.php line 327

wpfd_file_uploaded

Action fire after file uploaded

Parameters :

integer|WP_Error The file ID on success. The value 0 or WP_Error on failure.
array Additional information

Return :

void

In files :

/app/admin/models/files.php line 610

wpfd_save_category

Action fire after save category parameters

Parameters :

integer Term id
array Category params

Return :

void

In files :

/app/admin/controllers/category.php line 138

wpfd_save_category_settings_button

Action fire before category save button in right panel

Parameters :

integer Current category id

Return :

void

In files :

/app/admin/views/category/tpl/default.php line 279

wpfd_save_file_params

After file data was saved to database

Parameters :

array File data array

Return :

void

In files :

/app/admin/models/file.php line 127

wpfd_update_category_name

Update category name

Parameters :

integer Term id to change name
string New category name

Return :

void

In files :

/app/admin/controllers/category.php line 99

wpfd_{$themeName}_after_template_hooks

Action fire after template hooked

Parameters :

none

Return :

void

In files :

/app/site/themes/wpfd-ggd/theme.php line 115
/app/site/themes/wpfd-tree/theme.php line 82
/app/site/themes/templates/wpfd-theme.class.php line 460

wpfd_{$themeName}_after_theme_content

Action print after theme content

Parameters :

object Current theme instance
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 213
/app/site/themes/wpfd-table/tpl.php line 234
/app/site/themes/wpfd-default/tpl.php line 239
/app/site/themes/templates/tpl-default.php line 218

wpfd_{$themeName}_before_files_loop

Action fire before files loop

Parameters :

object Current theme params
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 172
/app/site/themes/wpfd-table/tpl.php line 136
/app/site/themes/wpfd-default/tpl.php line 151
/app/site/themes/templates/tpl-default.php line 138

wpfd_{$themeName}_before_files_loop_handlebars

Action fire before files loop in handlebars template

Parameters :

array Current theme params
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 95
/app/site/themes/wpfd-table/tpl.php line 31
/app/site/themes/wpfd-default/tpl.php line 31
/app/site/themes/templates/tpl-default.php line 29

wpfd_{$themeName}_before_template_hooks

Action fire before templates hooked

Parameters :

none

Return :

void

In files :

/app/site/themes/templates/wpfd-theme.class.php line 372

wpfd_{$themeName}_before_theme_content

Action print before theme content

Parameters :

object Current theme params

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 136
/app/site/themes/wpfd-table/tpl.php line 101
/app/site/themes/wpfd-default/tpl.php line 115
/app/site/themes/wpfd-tree/tpl.php line 133
/app/site/themes/wpfd-tree/tpl.php line 179
/app/site/themes/templates/tpl-default.php line 106

wpfd_{$themeName}_buttons

Action to show buttons

Parameters :

object Current file object
array Global config
array Category config

Return :

void

In files :

/app/site/themes/wpfd-table/tpl.php line 210
/app/site/themes/wpfd-default/tpl.php line 216
/app/site/themes/templates/tpl-default.php line 197

wpfd_{$themeName}_buttons_handlebars

Action print buttons in handlebars template

Parameters :

array $config Main config
array $params Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 71
/app/site/themes/wpfd-table/tpl.php line 77
/app/site/themes/wpfd-default/tpl.php line 95
/app/site/themes/wpfd-tree/tpl.php line 73
/app/site/themes/templates/tpl-default.php line 87

wpfd_{$themeName}_columns

Action to show columns

Parameters :

array Main config
array Category config

Return :

void

In files :

/app/site/themes/wpfd-table/tpl.php line 161

wpfd_{$themeName}_file_block

Action to show file block

Parameters :

object Current file object
array Global config
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 192

wpfd_{$themeName}_file_block_handlebars

Action to show file block in handlebars template

Parameters :

array Main config
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 117

wpfd_{$themeName}_file_content

Action to show file content

Parameters :

object Current file object
array Global config
array Category config

Return :

void

In files :

/app/site/themes/wpfd-default/tpl.php line 175
/app/site/themes/templates/tpl-default.php line 160

wpfd_{$themeName}_file_content_handlebars

Action print file content in handlebars template

Parameters :

array $config Main config
array $params Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 32
/app/site/themes/wpfd-default/tpl.php line 55
/app/site/themes/wpfd-tree/tpl.php line 33
/app/site/themes/templates/tpl-default.php line 51

wpfd_{$themeName}_file_info

Action to show file info

Parameters :

object Current file object
array Category config

Return :

void

In files :

/app/site/themes/wpfd-table/tpl.php line 190
/app/site/themes/wpfd-default/tpl.php line 196
/app/site/themes/templates/tpl-default.php line 179

wpfd_{$themeName}_file_info_handlebars

Action to show file info in handlebars template

Parameters :

array Global config
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 53
/app/site/themes/wpfd-table/tpl.php line 58
/app/site/themes/wpfd-default/tpl.php line 76
/app/site/themes/wpfd-tree/tpl.php line 55
/app/site/themes/templates/tpl-default.php line 70

wpfd_{$themeName}_folder_tree

Action print folder tree

Parameters :

object Current theme params
array Category config

Return :

void

In files :

/app/site/themes/wpfd-ggd/tpl.php line 153
/app/site/themes/wpfd-table/tpl.php line 117
/app/site/themes/wpfd-default/tpl.php line 132
/app/site/themes/templates/tpl-default.php line 121

wpfd_before_save_category

Filter for category parameters before save to database

Parameters :

array Category params
integer Term id

Return :

array

In files :

/app/admin/controllers/category.php line 128

wpfd_before_save_file_metadata

Filter allow modify file meta data before save to database

Parameters :

array File meta data array

Return :

array

In files :

/app/admin/models/file.php line 118

wpfd_before_save_file_params

Filter allow modify file data before save to database

Parameters :

array File data array

Return :

array

In files :

/app/admin/models/file.php line 69

wpfd_before_update_category_name

Filter update category name

Parameters :

string New category name
integer Term id to change name

Return :

string|boolean

In files :

/app/admin/controllers/category.php line 91

wpfd_before_upload_file

Filter before upload file

Parameters :

array File data
integer Current user id

Return :

array

In files :

/app/admin/models/files.php line 563

wpfd_can_create_new_category

Filter allow to create new category in admin

Parameters :

boolean User can create category

Return :

boolean

In files :

/app/admin/controllers/category.php line 41

wpfd_file_info

Filter file info in front

Parameters :

object File object

Return :

object

In files :

/app/site/models/files.php line 232
/app/site/models/file.php line 232
/app/site/models/file.php line 305

wpfd_file_params

Filter to update data before load to fields

Parameters :

array Data load to fields

Return :

array

In files :

/app/admin/views/file/view.php line 99

wpfd_file_title

Filter to change file title

Parameters :

string File title
integer File id

Return :

string

In files :

/app/site/models/files.php line 134
/app/site/models/files.php line 221
/app/site/models/file.php line 77
/app/site/models/file.php line 272
/app/site/models/file.php line 186

wpfd_get_support_cloud

Filter return supported cloud platform
Require to detect where categories/files from

Parameters :

array Cloud platform list

Return :

array

In files :

/app/functions.php line 765

wpfd_get_template

Allow 3rd party plugin filter

Parameters :

string Template path
string Template name
array Template variables
string Template path dir
string Default path dir

Return :

string

In files :

/app/functions.php line 621

wpfd_locate_template

Filter on return found template path

Parameters :

string Template path
string Template name
string Template path dir

Return :

void

In files :

/app/functions.php line 583

wpfd_locate_theme

Filter on return found template path

Parameters :

string Template path
string Template name
string Template path dir

Return :

void

In files :

/app/functions.php line 708

wpfd_preview_service_url

Filter to change preview service url

Parameters :

string Preview url with %s placeholder for url

Return :

string

In files :

/app/site/helpers/WpfdHelperFile.php line 58

wpfd_preview_url

Filter to change preview url

Parameters :

string Output url
string Preview url with %s placeholder for file encoded url
string Ajax Url to preview file

Return :

string

In files :

/app/site/helpers/WpfdHelperFile.php line 68

wpfd_search_results

Filters for search results

Parameters :

array Files results
array Search filters

Return :

array

In files :

/app/site/models/search.php line 277

wpfd_token_live_time

Filter to change token live time

Parameters :

int Token live time in seconds

Return :

int

In files :

/app/site/models/tokens.php line 120
/app/site/models/tokens.php line 167

wpfd_{$themeName}_back_button_handlebars

Filter to change html and arguments of back button handlebars

Parameters :

array Template array
object Current theme object
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1517

wpfd_{$themeName}_category_item

Filter to change html and arguments of categories item

Parameters :

array Template array
object Current category object
object Current theme object
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1658

wpfd_{$themeName}_category_item_handlebars

Filter to change html and arguments of categories item handlebars

Parameters :

array Template array
object Current theme object
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1610

wpfd_{$themeName}_category_title

Filter to change html and arguments of category title

Parameters :

array Template array
object Current theme object
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1570

wpfd_{$themeName}_category_title_handlebars

Filter to change html and arguments of category title handlebars

Parameters :

array Template array
object Current theme object
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1537

wpfd_{$themeName}_category_tree

Filter to change html and arguments of category tree

Parameters :

array Template array
object Current theme object
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1693

wpfd_{$themeName}_column_created_header_html

Filter to change html header of created date column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 698

wpfd_{$themeName}_column_description_header_html

Filter to change html header of description column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 602

wpfd_{$themeName}_column_download_header_html

Filter to change html header of download column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 746

wpfd_{$themeName}_column_hits_header_html

Filter to change html header of hits column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 674

wpfd_{$themeName}_column_modified_header_html

Filter to change html header of modified date column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 722

wpfd_{$themeName}_column_size_header_html

Filter to change html header of size column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 650

wpfd_{$themeName}_column_title_header_html

Filter to change html header of title column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 578

wpfd_{$themeName}_column_version_header_html

Filter to change html header of version column

Parameters :

string Header html

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 626

wpfd_{$themeName}_content_wrapper

Filter to change content wrapper output

Parameters :

string Content wrapper
object Current theme object

Return :

string

In files :

/app/site/themes/templates/wpfd-theme.class.php line 500

wpfd_{$themeName}_content_wrapper_input

Filters to print hidden input below content wrapper

Parameters :

string Input html
object Current theme object

Return :

string

In files :

/app/site/themes/templates/wpfd-theme.class.php line 520

wpfd_{$themeName}_file_download_button_args

Filter to change html and arguments of download button

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1272

wpfd_{$themeName}_file_download_button_handlebars_args

Filter to change html and arguments of download button handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1222

wpfd_{$themeName}_file_info_created_args

Filter to change html and arguments of created

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 944

wpfd_{$themeName}_file_info_created_handlebars_args

Filter to change html and arguments of created handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 906

wpfd_{$themeName}_file_info_description_args

Filter to change html and arguments of description

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 641

wpfd_{$themeName}_file_info_description_handlebars_args

Filter to change html and arguments of description handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 602

wpfd_{$themeName}_file_info_hits_args

Filter to change html and arguments of hits

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 870

wpfd_{$themeName}_file_info_hits_handlebars_args

Filter to change html and arguments of hits handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 832

wpfd_{$themeName}_file_info_icon_hanlebars

Filter to change icon html for handlebars template

Parameters :

string Output html for handlebars template
array Main config
array Current category config

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 185
/app/site/themes/templates/wpfd-theme.class.php line 1056

wpfd_{$themeName}_file_info_icon_html

Filter to change icon html

Parameters :

string Output html for handlebars template
object Current file object
array Main config
array Current category config

Return :

string

In files :

/app/site/themes/wpfd-table/theme.php line 265
/app/site/themes/templates/wpfd-theme.class.php line 1099

wpfd_{$themeName}_file_info_modified_args

Filter to change html and arguments of modified

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1018

wpfd_{$themeName}_file_info_modified_handlebars_args

Filter to change html and arguments of modified handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 980

wpfd_{$themeName}_file_info_size_args

Filter to change html and arguments of size

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 796

wpfd_{$themeName}_file_info_size_handlebars_args

Filter to change html and arguments of size handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 757

wpfd_{$themeName}_file_info_title_args

Filter to change html and arguments of title

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/wpfd-table/theme.php line 290
/app/site/themes/templates/wpfd-theme.class.php line 1174

wpfd_{$themeName}_file_info_title_handlebars_args

Filter to change html and arguments of title handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/wpfd-table/theme.php line 209
/app/site/themes/templates/wpfd-theme.class.php line 1135

wpfd_{$themeName}_file_info_version_args

Filter to change html and arguments of version

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 720

wpfd_{$themeName}_file_info_version_handlebars_args

Filter to change html and arguments of version handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 679

wpfd_{$themeName}_file_open_pdf_button_args

Filter to change html and arguments of open pdf button

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1407

wpfd_{$themeName}_file_open_pdf_button_handlebars_args

Filter to change html and arguments of open pdf button handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1320

wpfd_{$themeName}_file_preview_button_args

Filter to change html and arguments of preview button

Parameters :

array Template array
object Current file object
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1442

wpfd_{$themeName}_file_preview_button_handlebars_args

Filter to change html and arguments of preview button handlebars

Parameters :

array Template array
array Main config
array Current category config

Return :

array

In files :

/app/site/themes/templates/wpfd-theme.class.php line 1352

Composer

composer logo Here is the solution to use our plugins as a composer dependency.
You have to declare in your composer.json file the joomunited repository, please make sure to replace the YOUR_TOKEN in the url by your own token. You can find it under https://www.joomunited.com/my-account under the Composer token accordion.
{
   "repositories":[
      {
         "type":"package",
         "package":{
            "name":"joomunited/wp-file-download",
            "version":"master",
            "type":"wordpress-plugin",
            "dist":{
               "type":"zip",
               "url":"https://www.joomunited.com/extra/download/wp-file-download/YOUR_TOKEN",
               "reference":"master"
            }
         }
      }
   ],
   "require":{
      "composer/installers":"~1.0",
      "joomunited/wp-file-download":"dev-master"
   }
}