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 :

/class/class-media-folder.php line 3508
/class/class-wp-folder-option.php line 225

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 :

/class/class-media-folder.php line 311
/class/class-media-folder.php line 1430
/class/class-media-folder.php line 1909
/class/class-media-folder.php line 2308
/class/class-media-folder.php line 2378
/class/class-media-folder.php line 3149
/class/class-wp-folder-option.php line 442
/class/class-wp-folder-option.php line 2290

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 :

/class/class-media-folder.php line 1407
/class/class-media-folder.php line 2028
/class/class-wp-folder-option.php line 288
/class/class-wp-folder-option.php line 389
/class/class-wp-folder-option.php line 2185
/class/class-wp-folder-option.php line 2219

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 :

/class/class-media-folder.php line 2178
/class/class-media-folder.php line 2242

wpmf_duplicate_attachment

Duplicate an attachment

Parameters :

integer Attachment ID
integer Target folder

Return :

void

In files :

/class/class-duplicate-file.php line 114

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 :

/class/class-media-folder.php line 2460
/class/class-wp-folder-option.php line 1848

wpmf_update_folder_name

Update folder name

Parameters :

integer Folder ID
string Updated name

Return :

void

In files :

/class/class-media-folder.php line 2103

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 :

/class/class-replace-file.php line 170

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 :

/class/class-wp-folder-option.php line 252
/class/class-wp-folder-option.php line 572

wpmf_set_file_title

Manipulate file title before saving it into database

Parameters :

string File title

Return :

string

In files :

/class/class-media-folder.php line 3260

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 :

/class/class-replace-file.php line 43
/class/class-replace-file.php line 245
/class/class-duplicate-file.php line 59
/class/install-wizard/install-wizard.php line 54
/class/class-image-watermark.php line 157
/class/class-media-folder.php line 142
/class/class-media-folder.php line 466
/class/class-media-folder.php line 676
/class/class-media-folder.php line 711
/class/class-media-folder.php line 1292
/class/class-media-folder.php line 1326
/class/class-media-folder.php line 1995
/class/class-media-folder.php line 2062
/class/class-media-folder.php line 2131
/class/class-media-folder.php line 2351
/class/class-media-folder.php line 2417
/class/class-media-folder.php line 2494
/class/class-media-folder.php line 2808
/class/class-media-folder.php line 2939
/class/class-media-folder.php line 3125
/class/class-media-folder.php line 3385
/class/class-media-folder.php line 3786
/class/class-media-folder.php line 3833
/class/pages/settings/general.php line 270
/class/pages/settings/wordpress_gallery.php line 85
/class/pages/settings/image_compression.php line 44
/class/pages/settings/image_compression.php line 97
/class/pages/settings/image_compression.php line 251
/class/pages/settings/image_compression.php line 287
/class/class-wp-folder-option.php line 143
/class/class-wp-folder-option.php line 475
/class/class-wp-folder-option.php line 518
/class/class-wp-folder-option.php line 558
/class/class-wp-folder-option.php line 651
/class/class-wp-folder-option.php line 1222
/class/class-wp-folder-option.php line 1267
/class/class-wp-folder-option.php line 1396
/class/class-wp-folder-option.php line 2148
/class/class-wp-folder-option.php line 2343
/class/class-wp-folder-option.php line 2426
/class/class-wp-folder-option.php line 2473
/class/class-wp-folder-option.php line 2557
/class/class-wp-folder-option.php line 2608
/class/class-wp-folder-option.php line 2656
/wp-media-folder.php line 35
/jutranslation/jutranslation.php line 109
/juupdater/juupdater.php line 954
/juupdater/juupdater.php line 1003

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"
   }
}