WP Media Folder 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!

wpmf_add_attachment

Create an attachment when importing or syncing files from FTP
This hook is also used when a remote video is created

Parameters :

integer Created attachment ID
integer|array Target folder or array of target folders
array Extra informations

Return :

void

In files :

line 3832
line 200

wpmf_attachment_set_folder

Set attachment folder after moving an attachment to a folder in the media manager
This hook is also used when importing attachment to categories, after an attachment upload and
when assigning multiple folder to an attachment

Parameters :

integer Attachment ID
integer|array Target folder or array of target folders
array Extra informations

Return :

void

In files :

line 482
line 513
line 1681
line 2148
line 2550
line 2606
line 2680
line 3482
line 2548

wpmf_before_delete_folder

Before delete a folder

Parameters :

WP_Term Folder, this term is not available anymore as it as been deleted

Return :

void

In files :

line 2405
line 2473

wpmf_create_folder

Create a folder from media library
This hook is also used when syncing and importing files from FTP, creating user and role based folders
and importing from Nextgen Gallery

Parameters :

integer Created folder ID
string Created folder name
integer Parent folder ID
array Extra informations

Return :

void

In files :

line 1658
line 2256
line 294
line 1262
line 2445
line 2479

wpmf_delete_folder

Delete a folder

Parameters :

WP_Term Folder, this term is not available anymore as it as been deleted

Return :

void

In files :

line 2412
line 2482

wpmf_duplicate_attachment

Duplicate an attachment

Parameters :

integer Attachment ID
integer Target folder

Return :

void

In files :

line 104

wpmf_move_folder

Move a folder from media library
This hook is also used when role folder option is changed

Parameters :

integer Folder moved ID
string Destination folder ID
array Extra informations

Return :

void

In files :

line 2767
line 2039

wpmf_update_folder_name

Update folder name

Parameters :

integer Folder ID
string Updated name

Return :

void

In files :

line 2338

fallback_intermediate_image_sizes

Filters the image sizes generated for non-image mime types.

Parameters :

array $fallback_sizes An array of image size names.
array $metadata Current attachment metadata.

Return :

void

In files :

line 33

wpmf_import_allowed_filetypes

Filter the filetype allowed to be imported through ftp or folder import

Parameters :

array Filetypes allowed to be imported

Return :

array

In files :

line 482
line 1220

wpmf_set_file_title

Manipulate file title before saving it into database

Parameters :

string File title

Return :

string

In files :

line 3583

wpmf_user_can

Filter check user capability to do an action

Parameters :

boolean The current user has the given capability
string Action name

Return :

boolean

In files :

line 109
line 43
line 206
line 53
line 54
line 173
line 316
line 637
line 847
line 882
line 1538
line 1572
line 2226
line 2292
line 2365
line 2649
line 2721
line 2803
line 3124
line 3257
line 3442
line 3690
line 4117
line 4164
line 115
line 385
line 428
line 468
line 562
line 1149
line 1423
line 1577
line 2408
line 2601
line 2684
line 2731
line 2815
line 2866
line 2914
line 44
line 98
line 252
line 288
line 317
line 113
line 35

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-media-folder",
            "version":"master",
            "type":"wordpress-plugin",
            "dist":{
               "type":"zip",
               "url":"https://www.joomunited.com/extra/download/wp-media-folder/YOUR_TOKEN",
               "reference":"master"
            }
         }
      }
   ],
   "require":{
      "composer/installers":"~1.0",
      "joomunited/wp-media-folder":"dev-master"
   }
}

Please not that composer update command can't work on private repositories (for more explanation please refer to the composer documentation)
Though, you can manually update the plugin to the latest version with this command:
composer remove joomunited/wp-media-folder && composer clearcache && composer require joomunited/wp-media-folder:dev-master