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 3665
/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 344
/class/class-media-folder.php line 375
/class/class-media-folder.php line 1514
/class/class-media-folder.php line 2004
/class/class-media-folder.php line 2402
/class/class-media-folder.php line 2458
/class/class-media-folder.php line 2528
/class/class-media-folder.php line 3300
/class/class-wp-folder-option.php line 442
/class/class-wp-folder-option.php line 2305

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 1491
/class/class-media-folder.php line 2120
/class/class-wp-folder-option.php line 288
/class/class-wp-folder-option.php line 389
/class/class-wp-folder-option.php line 2200
/class/class-wp-folder-option.php line 2234

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 2270
/class/class-media-folder.php line 2334

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 2610
/class/class-wp-folder-option.php line 1869

wpmf_update_folder_name

Update folder name

Parameters :

integer Folder ID
string Updated name

Return :

void

In files :

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

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 171

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 3411

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 246
/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 175
/class/class-media-folder.php line 530
/class/class-media-folder.php line 740
/class/class-media-folder.php line 775
/class/class-media-folder.php line 1376
/class/class-media-folder.php line 1410
/class/class-media-folder.php line 2087
/class/class-media-folder.php line 2154
/class/class-media-folder.php line 2223
/class/class-media-folder.php line 2501
/class/class-media-folder.php line 2567
/class/class-media-folder.php line 2644
/class/class-media-folder.php line 2958
/class/class-media-folder.php line 3089
/class/class-media-folder.php line 3276
/class/class-media-folder.php line 3536
/class/class-media-folder.php line 3943
/class/class-media-folder.php line 3990
/class/pages/settings/general.php line 270
/class/pages/settings/wordpress_gallery.php line 106
/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 2163
/class/class-wp-folder-option.php line 2358
/class/class-wp-folder-option.php line 2441
/class/class-wp-folder-option.php line 2488
/class/class-wp-folder-option.php line 2572
/class/class-wp-folder-option.php line 2623
/class/class-wp-folder-option.php line 2671
/wp-media-folder.php line 35
/jutranslation/jutranslation.php line 109

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