Media Library Folders Quickstart

INDEX

QUICKSTART GUIDE

Installation

Media Library Folders

To install the Media Library Folders download the Media Library Folders plugin from the WordPress repo and follow the installation instructions. On activation Media Library Folders will scan all the attachments in the Media Library and create a database of folders.

Once the Media Library Folders is activated you will see Media Library Folders in the WordPress dashboard menu. And you are ready to go!

Media Library Folders Pro is a separate plugin to Media Library Folders

To install Media Library Folders Pro, download the plugin from your Account and follow the installation instructions.

Before installing Media Library Folders Pro you will want to deactivate Media Library Folders. This won’t affect files or folders added with MLF but will avoid you getting error codes and wonder where all of the great MLFP capabilities are.

Installation Instructions

For automatic installation:

  1. Login to your website and go to the Plugins section of your admin panel.
  2. Click the Add New button.
  3. Click the Upload Plugin button at the top of the Add Plugins page.
  4. Select the plugin zip file from your computer then click the Install Now button.
  5. You should see a message stating that the plugin was installed successfully.
  6. Click the Activate Plugin link.
 

For manual installation:

  1. You should have access to the server where WordPress is installed. If you don’t, see your system administrator.
  2. Copy and unzip the plugin file in your wp-content/plugins folder.
  3. Login to your website and go to the Plugins section of your admin panel.
  4. Look for “Media Library Folders Pro for WordPress” and click Activate.
 

To upload by FTP:

  1. Unzip the plugin zip file.
  2. Upload the folder created by the zip file to the /wp-content/plugins directory of your WordPress installation.
  3. Login to your website and go to the Plugins section of your admin panel.
  4. Look for “Media Library Folders Pro for WordPress” and click Activate.

Activation of License keys

With the purchase of your plugin you have received

  • Download links for the plugin
  • One or more plugin license keys
  • A login password to log into MaxGalleria.com
 

Your login user name will be the email address you used when you made your purchase.

When you log into MaxGalleria.com, will be taken the ‘my account’ page where you will find links to all your purchased plugins under Downloads, an Edit Profile page, license keys under Licenses and a Payments and Receipts page where you can print an invoice should you need a copy for you records.

For activating the key for Media Library Folders Pro, this plugin has its own Settings page, where you can enter, save and activate the plugin.

Once the license keys have been installed and activated you can update your plugins through the WordPress Updates page.

MEDIA LIBRARY FOLDERS BASIC FEATURES

Overview

When you click on Media Library Folders it displays a tree of folders on the left side of the page and the the contents of the current folder on the right site. If you run into any problems with loading your folder data please contain us on the support page. We give great support.

We assume your site has the WordPress Media Library setting option ‘Organize my uploads into month- and year-based folders’ selected. If not the plugin automatically changes your settings to this. To view the contents of a folder, click on the folder image. To navigate up in the folder structure click on the links in the Location: breadcrumb string.

Clicking an image will take you to the image attachment details page. If you close that page when you are done you will be in the old media library. Instead click your browser’s go back button twice and you will be taken back to the folder page.

Button Bar

The Button Bar provides the main functionality to manage folders and files and is located below the breadcrumbs navigation. When the mouse hovers over a button its function is displayed in the message area below the button bar.

File/Folder Organizing Buttons

Clicking the Add New button displays the upload box:

Here you can select a single file to upload one or more files by dragging the image from the file manager and dropping them in the upload box. Uploaded files will be added to the current folder.

New Folder – Allows you to create a new folder in the current directory.

Move/Copy Toggle – The move/copy function lets you to move or copy selected files to another folder by drag and drop. To move a single file, grab with with the mouse, drag and hold the mouse pointer, not the image, over the file folder where you want to move the image and release the mouse. To move multiple files, check the images’ checkboxes then drag any of the checked and hold the mouse, not the image over the destination folder and release the mouse. To copy one or more images to another folder first click on the move copy toggle to put in into copy mode and then drag a single to a destination folder and hold the mouse pointer over it and release it. To drag multiple files, check the images’ checkboxes and drag one of the check images in the same manner to the destination folder.

Rename – Rename a file in the current directory. Folders cannot be renames.

Delete – The delete function let you delete select files. Using the folder tree, you can delete a folder, right click on a folder you want to delete (CTRL-click on a Mac). This action will display a popup menu. Click “Delete this Folder?” and if the folder is empty, then it will be removed. If you get a message that the folder is not empty, view that folder and click the Sync button to add any files on the server that are not in the media library. Then you can remove the files and delete the folder as explained above.

Also, you can hide folders by right click on a folder you want to hide (CTRL-click on a Mac). Choose the option “Hide this folder?”. Clicking on this option will remove the folder, its sub folders and files from the Media Library but not from your server. This action will also write a file to the folder with the name “mlpp-hidden”. As long as that file is present, Media Library Plus will skip over this folder when checking for folders and files to add to the Media Library.

Select/Unselect – Select or unselect all files in the current directory.

Sync – In the event that a file is uploaded but not added to the media library database the Sync function will scan the current folder on the server and add any new files or folders it finds. It does not remove missing files or folders. It also works like a bulk add for the media library; just upload your files by FTP to an existing folder and then click the Sync button for that folder to add them all at one time. But note there is a limit to the number of files that Sync can handle at one time which is about 60 files.

Sort by Date/Sort by Name – changes the display order of items in the current directory; either by name or by date.

Search – Users can search for a file or folder by typing in the name of the file in the search box and pressing Enter.

The search results page will display files and/or folders that are similar to the search text. You can click on an image or file to go to its folder or click on a folder view its contents.

Adding your organized media to MaxGalleria Galleries

Add to Gallery – Once you get everything organized in folders you use this button to add selected files to a gallery. This button will not let you upload an entire folder. It only lets you upload selected media files. You can open a folder a simply click Select All to upload the entire contents of a folder. Also, it’s built to not let you add duplicate images to a gallery.

Working with Images and Galleries

Media Library Folders and it’s organization abilities are only accessible from Media Library Folders plugin.

If you access the media library through MaxGalleria to add images to one of your galleries, MaxGalleria will display the WordPress Media Library to source your media. The WordPress Media Library images will not be organized as they are in Media Library Folders.

For this reason we recommend that you use MLF for not only organizing your libraries but also adding images to your galleries on an ongoing basis.

MEDIA LIBRARY FOLDERS PRO FEATURES

Media Categories

A Categories button can be found in the toolbar:

Clicking the Categories button will reveal the Categories area.

From this area you can:

  • Add a new category
  • Set the category of items in the media library
  • View the categories of a single item
  • Display items by categories
  • Change the sort order of items in categories

 

Add a new category by click the Add New Category button

Once added the new category automatically shows up in the category list.

If you want to see what categories have been assigned to a particular image, check an image you and then click the Get Categories button.

One can do the same even when the Categories Area is not displayed. Just click on an image and click the Categories button. When it loads the categories, the category associated with the check image will be checked.

To view all the images in one or more categories, check the checkboxes of the categories you want to view and press the View Categories button. If there are more than 40 items to display you will be prompted to view either the images of the titles of the images or files.

When viewing items by category you can specify the sorting order.

With the items displayed by categories, you can  select items from the list to perform move, copy, regenerate thumbnails or add to a MaxGalleria gallery operations.

Frontend Uploading

Frontend uploading of files is available via a shortcode, This feature allows your signed in users to upload files to specified folders without needing to grant them access to your dashboard or media library.

The shortcode, ‘mlfp-image-file-upload’ can use three parameters:

folder_id

This is a required parameter. To find your folder ID, go to the Media Library Folders Pro in your WordPress dashboard and hover your mouse over the destination folder you want to use. While hovering, take note of the link displaying in the status bar at the bottom of the page. It will look something like this:

http://example.com/wp-admin/admin.php?page=media-library-folders#4516

The number after the ‘#’ is the folder ID.

display_image=”1″

The default behavior after uploading the image will be a standard success message. If you want to show the uploaded image instead of a message, just use display_image=”1″. Note: if the file being uploaded is not an image file then using the default success message is best. If the display_image=”1″ is used, nothing will display.

file_types

You can specify which file types are allowed to be uploaded by entering the file extension with this file_types option. Each extension used must begin with a ‘.’ and they should be separated by commas, i.e. file_types=”.jpg,.png” or file_types=”.docx,.pdf”.

Short code example:

[mlfp-image-file-upload folder_id=”4516″ display_image=”1″ file_types=”.jpg,.png”]


Note: To enable this feature, you’ll have to check the ‘Enable Front End Upload’ option in the Media Library Folders Pro Settings

For security reasons, this option is only available to logged in users.

File Replacement

The replace file feature allows one to replace an existing file in the media library. There are two types of replacement: 1. Replace the file and its thumbnail images and change nothing else while keeping the old file name; 2. Replace the file with a new file, change the name and update links embedded in posts and page.

There is a limitation when updating embedded links in that thumbnail file size and the names of the thumbnail files may vary for different images and this may cause some links that no longer work. Users should check that the updated links still function. To minimize this limitation, Media Library Folders Pro will only allow file replacement with files of the same type, for example, replace JPG files with JPG files, PNG files with PNG files, PDF files with PDF files, etc.

When replacing a file, there is an option for changing the upload date stored in the database: keep the old date, use the current date or specify a custom date. This option does not affect the date of the file on the server.

To replacing a file:

  1. Select a file to replace by checking it’s checkbox.
  2. Click the Replace File button.
  3. Select the type of replacement to perform: only replace the file (without changing the file name or embedded links) or replace and update with new file (includes changing the file name in the media library and in any links embedded in posts and pages).
  4. Select whether to keep the current date of when the file was added to the media library or update the date or enter a custom date.
  5. Upload a replacement file. Either drag and drop a single file or click the Browse button to find and select a file and click the Upload Replacement button. Once a file is uploaded, the old file will be replaced and the Replace File area will automatically close.

Note that if the Image SEO feature is currently activated, it will be used when the user chooses to replace a file using the ‘Replace and update with new file’ option.

Multisite License Activation

Activating the license key in Media Library Folders Pro on a multisite installation the key can activated on all sites in the network from the main site’s Media Library Folders Pro Settings page. Previously, a site administrator had to visit the Media Library Folders Pro Settings page on each networked site, paste in, save and activate the license key.

First activate the license for the main site by entering the license key, clicking the Save Changes button and then clicking the Activate button.

After the page refreshes then the network license activate button will be displayed:

Click the Activate License on all Network Sites button to activate the license on all sites. This process will activate the license key on sites in the network where the plugin has not been activated. Note that we recommend not using Network Activate for activating the plugin on all sites in a multi site as this can cause a max execution time error. To avoid this issue, activate the plugin on each individual site.

An administrator can also deactivate the license key on all networked site in the manner.

Playlist shortcode Generator

WordPress uses a built-in shortcode to display playlists of audio or video files 

Audio Playlist

Video Playlist

To use the new shortcode generator, go to the Media Library Folders Pro Page, navigate to a folder containing video or audio files and click on the Playlist Shortcode button. This will reveal the shortcode generator. Now you can select the type of playlist to create and then click on the individual files you want to include in the playlist. As files are selected, Media Library Folders Pro check the type file selected and adds it ID number to the shortcode.

You can change to different folders to add more selections to the current playlist. Once the audio or video IDs are added, click the Generate Shortcode button to create the playlist shortcode and the Copy to Clipboard button to copy it. Then you can insert the shortcode into a post or page.

If it is necessary to filter the files in a folder, do that first before opening the playlist generator as opening the filter area will close and clear the playlist generator.

Image Filtering

Click the Filter Files button to reveal filter where you can type in the text you want to use to limit the display of images by file name in the current folder. File filtering will be very useful when searching for a file in a folder containing a large number of images.

Import/Export

The Import/Export feature allows an administrator to export a sites media library from one site to another. With this feature:

  • You can export and download the contents of your media library from one WordPress site and then upload and import it into the media library of another WordPress site. 
  • The feature will also work for media libraries on multi-sites, either multi-site library to single site library or single site library to multi-site library.
  • You can also import files to an AWS S3 bucket when connected to a site through Media Library Folders Pro S3.
  • It can even be used to simply create a back-up of your media library files.

 

How does it work?
 
Click on Media Library Import/Export in the Media Library Folders Pro sub-menu to access the import/export section. Click “Create New Backup” to generate a new backup of the site’s media library. 

You’ll be prompted to name your back-up (no need to add a file extension) and when you’re done, just click OK or hit the Enter button. 

The backup files will be generated and once the page refreshes, it will show the new backup. 

Please note: Backups do not include thumbnail images. These will be generated when the images are imported into the destination site. The only files and folders included in the backup will be those that are listed in the media library database. 

Your backup can now be downloaded simply by clicking “Download Backup”. There is also a “Delete Backup” option if you don’t need to or just prefer not to keep a copy on your site.

Once the file has been downloaded, you can then upload it on another site where Media Library Folders Pro version 6.0.0 has been installed. Simply go to Media Library Folders Pro Import / Export and click “Upload Backup”. You will then be promoted to select a backup file by browsing to where it was saved on your computer. Once selected, click “Upload Backup File” in the dialog box to start the upload.

Backups of media libraries can be quite big so in an effort to avoid triggering a file upload limit error, MLFP will upload the backup file in small chunks.

Once the file is finished uploading it will appear in the list of the backups and you can then click “Import Backup” to import the files and folders into the site’s media library.

This will begin a two-part process. First up, folders are added to the site. If one of the imported folder names already exist, Media Library Folders Pro won’t create a duplicate, instead it will use the existing folder during the file import.

Once the folders are created, then second part of the import process will begin, adding files to the appropriate folders. If a folder already contains a file with the same name as one being imported, it won’t replace it, but instead will simply skip that file and continue importing.

If for whatever reason, you need to abort the import, simply click “Stop Import” and the import process will be halted. You can restart the process at any time and any folders and files not already copied across will then be imported. The import will attempt a full import but since files are not overwritten, it will just skip past them.

Media Library Maintenance and Bulk File Importer

Have you noticed that your media library as become cluttered with numerous uncatalogued files and that this is affecting your site’s performance? Now with Media Library Maintenance you can easily inspect and remove those excess files.

Over time a site’s media library can build up a number of unneeded files, especially extra sizes of thumbnail files that are no longer needed due to theme or plugin changes or multiple thumbnail regenerations. Media Library Maintenance allows site administrators to find, view and remove or import these uncatalogued files.

To use, just click on the Media Library Maintenance menu option and click the Search for Uncatalogued Files button and Media Library Maintenance will scan of the media library’s folders for uncatalogued files and compile a list of each file it finds. This list will also include any folders not found on in the media library, that is, folders in the folder tree that don’t exists in the server.

Once the search is complete the files and folders can be reviewed.

Then any or all of the files can be marked to leave as they are, delete or import into the media library. After reviewing the list and marking any of the files, clicking the Process Files button will remove or import the selected files. It is simple and fast. But one should be certain to first make a backup of their entire media library in case there is a need to restore a particular image or file.

Note that some plugins add their own folders and files under the Upload folder and these files do not need to be included in the media library database. These folders can be removed from the media library by hiding them. This is done by right clicking on a folder to reveal a menu. Select the ‘Hide this folder?’ option and this action will remove the folder and its contents from the media library and from showing up in the folder tree. But the folder and its files will remain on the server.

In addition to cleaning your site’s media library, Media Library Maintenance is perfect tool for the bulk importation of new files. New files can be upload to new or existing folders under your Uploads folder. Then a search for uncatalogued files can be initiated which will add any new folders and then search all the folders for new files. When the search is complete, all the new files can be marked for importation. And the clicking the Process Files button will launch and complete the process of importing the files.

FREQUENTLY ASKED QUESTIONS

Unhide a Hidden Folder

  1. Go to the hidden folder via your cPanel or FTP and remove the file ‘mlfp-hidden’.
  2. In the Media Library Folders Menu, click the Check for New folders link. This will add the folder back into Media Library Folders
  3. Visit the unhidden folder in Media Library Folders and click the Sync button to add contents of the folder. Before doing this, check to see that there are no thumbnail images in the current folder since these will be regenerated automatically; these usually have file names such as image-name-150×150.jpg, etc.
  4. Repeat step 3 for each sub folder.

Delete a Folder

To delete a folder, right click (Ctrl-click with Macs) on a folder. A popup menu will appear with the options, ‘Delete this folder?’ and ‘Hide this folder?’. Click the delete option. The folder has to be empty in order to delete it. If you receive a message that the folder is not empty, use the sync function to display files that are still present in the folder.

Folders and images added to the site by FTP are not showing up in Media Library Folders

Media Library Folders does not work like the file manager on you computer. It only displays images and folders that have been added to the Media Library database. To display new folders that have not been added through the Media Library Folders you can click the Check for New Folders option in the Media Library Folders sub menu in the WordPress Dashboard. If you allow WordPress to store images by year and month folders, then you should click the option once each month to add these auto-generated folders.

To add images that were upload to the site via the cPanel or by FTP, navigate to the folder containing the images in Media Library Folders and click the Sync button. This will scan the folder looking images not currently found in the Media Library for that folder. The Sync function only scans the current folder. If there are sub-folders, you will need to individually sync them.

Upload Multiple Files

Users can upload multiple files by using drag and drop. When the Add Files button is click it revels the file upload area either single or multiple files can be highlight can be dragged from you computer’s file manager and dropped into the file uploads areas.

For MaxGalleria and Media Library Folders Pro technical support issues, it is best to log in to MaxGalleria.com and visit the Support Forum where there are individual forums for each plugin. There you can read previous posts that may address your issue. Note the technical support is limited to providing code for CSS fixes to your site, assistance with using built in plugin filters and actions and diagnosing issue on with your site. Custom coding or adding new features is not included in your technical support benefits.

TROUBLESHOOTING

Folder Tree Not Loading

Users who report this issue can usually fix it by running the Media Library Folders Reset plugin that comes with Media Library Folders.

First make sure you have installed the latest version of Media Library Folders.

Deactivate Media Library Folders and activate Media Library Folders Reset and run the Reset Database option from the Media Library Folders Reset sub menu in the dashboard.

After that, reactivate Media Library Folders. It will do a fresh scan of your media library database and no changes will be made to the files or folders on your site.

Folders Loads Indefinitely

This happens when a parent folder is missing from the folder data. To fix this you will need to perform a reset of the Media Library Folders database. To do this, deactivate Media Library Folders and activate Media Library Folders Reset and select the Reset Database option. Once the reset has completed, reactivate Media Library Folders and it will do a fresh scan of the Media Library data.

Unable to Insert files from Media Library Folders into Posts or Pages

For inserting images and files into posts and pages you will have to use the existing Media Library. The ability to insert items from the Media Library Folders user interface is only available in Media Library Folders Pro.

Folders and images added to the site by FTP are not showing up in Media Library Folders

Media Library Folders does not work like the file manager on you computer. It only display images and folders that have been added to the Media Library database. To display new folders that have not been added through the Media Library Folders you can click the Check for new folders option in the Media Library Folders submenu in the WordPress Dashboard. If you allow WordPress to store images by year and month folders, then you should click the option once each month to add these auto-generated folders.

To add images that were upload to the site via the cPanel or by FTP, navigate to the folder containing the images in Media Library Folders and click the Sync button. This will scan the folder looking images not currently found in the Media Library for that folder. The Sync function only scans the current folder. If there are subfolders, you will need to individually sync them.

Unable to Insert files from Media Library Folders into Posts or Pages

For inserting images and files into posts and pages you will have to use the existing Media Library. The ability to insert items from the Media Library Folders user interface is only available in Media Library Folders Pro. This does not mean you cannot insert files added to Media Library Folders into any WordPress posts or pages. Media Library Folders adds a folder user interface and file operations to the existing media library and it does not add a second media library. Since all the images are in the same media library there is no obstacle to inserting them anywhere WordPress allows media files to be inserted. There is just no folder tree available in the media library insert window for locating images in a particular folder. We chose to include the folder tree for inserting images in posts and page in the Pro version along with other features in order to fund the cost of providing free technical support and continued development of the plugin.

Unable to Update Media Library Folders Reset

Media Library Folders Reset is maintenance and diagnostic plugin that is included with Media Library Folders. It automatically updates when Media Library Folders is updated. There is no need to updated it separately. Users should leave the reset plugin deactivated until it is needed in order to avoid accidentally deleting your site’s folder data.

Images Not Found After Changing the Location of Uploads Folder

If you change the location of the uploads folder, your existing files and images will not be moved to the new location. You will need to delete them from media library and upload them again. Also you will need to perform a reset of the Media Library Folders database. To do this, deactivate Media Library Folders and activate Media Library Folders Reset and select the Reset Database option. Once the reset has completed, reactivate Media Library Folders and it will do a fresh scan of the Media Library data.

Difficulties Uploading or Dragging and Dropping a Large Number of Files

Limitations on web server processing time may cause dragging and dropping a large number of files to fail. An error is generated when it takes to longer then 30 seconds to move, copy or upload files. This time limitation can be increased by changing the max_execution_time setting in your site’s php.ini file.

Fatal error: Maximum execution time exceeded

The Maximum execution time error takes place when moving, syncing or uploading too many files at one time. The web site’s server has a setting for how long it can be busy with a task. Depending on your server, size of files and the transmission speed of your internet, you may need to reduce the number of files you upload or move at one time.

It is possible to change the maximum execution time either with a plugin such as WP Maximum Execution Time Exceeded or by editing your site’s .htaccess file and adding this line:

php_value max_execution_time 300

Which will raise the maximum execution time to five minutes.

If you move your site

Often users install their plugins on a development or temporary site before they move the entire site to main or production site. As a result, they report that they receive an error message ‘unauthorized’ when they try to update the plugin. If is because they failed to deactivate on the old site and activate the plugin on the new site. In cases like this, you are able to deactivate the old site from the download section of the my account page at MaxGalleria .com. On this page, under each plugin you have purchased is a Sites dropdown list. Click the down arrow to see a list of sites where your license is activate. To manually deactivate one of the sites in the list, click the x or close button next to the site address. You can then return to your site activate the plugin and perform the update.

In the event that you are still unable to update the plugin, the plugin can be manually updated by going to your account page and download the plugin. You will find it under its original name, Media Library Plus Pro. If you want to upload it by FTP, unzip the file and overwrite the existing folder in the plugins directory. If you want to upload it through the WordPress Plugins Add New page, you first have to deactivate and delete the old plugin and then upload the zip file. This does not affect any files and folders added to the site through Media Library Folders Pro.

More Troubleshooting Tips

HOOKS

Filters

mg_media_library_plus_post_type_args

add_filter(‘mg_media_library_plus_post_type_args’, ‘filter_type_args’);

Parameters

$args – post type paremeters

function filter_type_args($args)

$args = apply_filters(MGMLP_FILTER_POST_TYPE_ARGS, array(
‘public’ => false,
‘publicly_queryable’ => false,
‘show_ui’ => false,
‘show_in_nav_menus’ => false,
‘show_in_admin_bar’ => false,
‘show_in_menu’ => false,
‘query_var’ => true,
‘hierarchical’ => true,
‘supports’ => false,
‘exclude_from_search’ => true
));
return $args;
}

mgmlp_add_toolbar_buttons

add_filter(‘mgmlp_add_toolbar_buttons’, ‘add_toolbar_buttons’);

Parameters

$filter_output – button HTML code

function add_toolbar_buttons ($filter_output) {

return $filter_output;

}

mgmlp_add_toolbar_areas

add_filter(‘mgmlp_add_toolbar_areas’, ‘add_toolbar_area’);

Parameters
$filter_output

$filter_output – toolbar area HTML

function add_toolbar_area ($filter_output) {

return $filter_output;

}

mlfp_set_post_excerpt

(Adds text that can be used as the image caption when file is imported into Media Library Folders Pro during upload or sync)
add_filter(‘mlfp_set_post_excerpt’, ‘set_post_excerpt’);

Parameters
$post_caption – Text to be save in the post_excerpt field
$folder_name – name of the current folder

function set_post_excerpt ($post_caption, $folder_name) {

return $post_caption;

}

mlfp_filter_upload_destination

add_filter(‘mlfp_filter_upload_destination’, ‘filter_upload_destination’);

Parameters

$filename – the name of the file
$folder_id – the id of the parent folder

Returns

$folder_id

function filter_upload_destination($new_filename, $folder_id) {

return $folder_id;
}

Actions

mlfp_before_add_file

add_action(‘mlfp_before_add_file’, ‘process_before_add_file’, 10, 2);

Parameters

$new_filename – the name of the new file
$folder_id – the id of the destination folder

function process_before_add_file($new_filename, $folder_id) {

}

mlfp_process_new_file

add_action(‘mlfp_process_new_file’, ‘process_new_add_file’, 10, 2);

Parameters

$filename – the name of the file
$folder_id – the id of the parent folder

function process_new_add_file($filename, $folder_id) {

}

mlfp_after_add_file

add_action(‘mlfp_after_add_file’, ‘process_after_add_file’, 10, 2);

Parameters

$attach_id – the id of the attachment
$filename – the filename
$folder_id – the id of the parent folder

function process_after_add_file($attach_id, $filename, $folder_id) {

}

mlfp_before_folder_creation

add_action(‘mlfp_before_folder_creation’, ‘do_before_folder_creation’);

Parameters

$new_folder_path – path to new folder
$parent_folder_id – parent folder id
$new_folder_url – URL to the new folder

function do_before_folder_creation($new_folder_path, $parent_folder_id, $new_folder_url) {
}

mlfp_after_folder_creation

add_action(‘mlfp_after_folder_creation’, ‘do_after_folder_creation’);

Parameters

$new_folder_path – path to new folder
$parent_folder_id – parent folder id
$new_folder_url – URL to the new folder

function do_after_folder_creation($new_folder_path, $parent_folder_id, $new_folder_url) {

}

mlfp_before_file_move

add_action(‘mlfp_before_file_move’, ‘do_before_file_move’);

Parameters

$image_path – path to the image or file
$destination_name – path to the file in destination folder

function do_before_file_move($image_path, $destination_name) {

}

mlfp_after_file_move

add_action(‘mlfp_after_file_move’, ‘do_after_file_move’);

Parameters

$image_path – path to the image or file
$destination_name – path to the file in destination folder
$destination_url – new url of the image

function do_after_file_move($image_path, $destination_name, $destination_url) {

}

mlfp_before_file_copy

add_action(‘mlfp_before_file_copy’, ‘do_before_file_copy’);

Parameters

$image_path – path to the image or file
$destination_name – path to the file in destination folder

function do_before_file_copy($image_path, $destination_name) {

}

mlfp_after_file_copy

add_action(‘mlfp_after_file_copy’, ‘do_after_file_copy’);

Parameters

$image_path – path to the image or file
$destination_name – path to the file in destination folder
$destination_url – new URL of the file in the destination folder
$folder_id – new folder ID

function do_after_file_copy($image_path, $destination_name, $destination_url, $folder_id) {

}

mlfp_before_file_rename

add_action(‘mlfp_before_file_rename’, ‘do_before_file_rename’);

Parameters

$old_file_path – path to the old file name
$new_file_path – path to the new file name

function do_before_file_rename($old_file_path, $new_file_path) {

}

mlfp_after_file_rename

add_action(‘mlfp_after_file_rename’, ‘do_after_file_rename’);

Parameters

$old_file_path – path to the old file name
$new_file_path – path to the new file name

function do_after_file_rename(do_after_file_rename) {

}

mlfp_before_file_or_folder_delete

add_action(‘mlfp_before_file_or_folder_delete’, ‘do_before_file_or_folder_delete’);

Parameters

$delete_id – id of the file or folder to delete
$folder_path – path to the item to delete
$post_type (‘attachment’ or ‘mgmlp_media_folder’)

function do_before_file_or_folder_delete($delete_id, $folder_path, $post_type) {

}

mlfp_after_file_or_folder_delete

add_action(‘mlfp_after_file_or_folder_delete’, ‘do_after_file_or_folder_delete’);

Parameters

$old_file_path – path to the old file name
$new_file_path – path to the new file name
$post_type (‘attachment’ or ‘mgmlp_media_folder’)

function do_after_file_or_folder_delete($delete_id, $folder_path, $post_type) {

}

mlfp_before_folder_hide

add_action(‘mlfp_before_folder_hide’, ‘do_before_folder_hide’);

Parameters

$folder_id – ID of the folder to hide
$attached_file (relative path to the folder)

function do_before_folder_hide($folder_id, $attached_file) {

}

mlfp_after_folder_hide

add_action(‘mlfp_after_folder_hide’, ‘do_after_folder_hide’);

Parameters

$folder_id – ID of the folder to hide
$attached_file (relative path to the folder)

function do_after_folder_hide($folder_id, $attached_file) {

}

mlfp_before_add_category

add_action(‘mlfp_before_add_category’, ‘do_before_add_category’);

Parameters

$new_category – category to add

function do_before_add_category($new_category) {

}

mlfp_after_add_category

add_action(‘mlfp_after_add_category’, ‘do_after_add_category’);

Parameters

$new_category – category added
$term_id – new term ID
$term_taxonomy_id – term taxonomy ID

function do_before_add_category($new_category, $term_id, $term_taxonomy_id){

}

mlfp_before_sync_file

add_action(‘mlfp_before_sync_file’, ‘do_before_sync_file’);

Parameters

$new_attachment – file to import
$parent_folder – parent folder
$new_file_title – file title
$mlp_alt_text – alt text
$mlp_title_text – text title

function do_before_sync_file($new_attachment, $parent_folder, $new_file_title, $mlp_alt_text, $mlp_title_text) {

}

mlfp_after_sync_file

add_action(‘mlfp_after_sync_file’, ‘do_after_sync_file’);

Parameters

$new_attachment – file to import
$parent_folder – parent folder
$new_file_title – file title
$mlp_alt_text – alt text
$mlp_title_text – text title
$attach_id – ID of the imported file
$absolute_path – absolute path to the imported file
$file_url – URL to the imported file

function do_after_sync_file($new_attachment, $parent_folder, $new_file_title, $mlp_alt_text, $mlp_title_text, $attach_id, $absolute_path, $file_url) {

}

mlfp_before_thumbnail_regen

add_action(‘mlfp_before_thumbnail_regen’, ‘do_before_thumbnail_regen);

Parameters

$attachment_id – id of the image
$attachment_path – path to the image

function do_before_thumbnail_regen($attachment_id, $attachment_path) {

}

mlfp_after_thumbnail_regen

add_action(‘mlfp_after_thumbnail_regen’, ‘do_after_thumbnail_regen’);

Parameters

$attachment_id – id of the image
$attachment_path – path to the image
$metadata – metadata for regenerate file

function do_after_thumbnail_regen($attachment_id, $attachment_path, $metadata) {

}

mlfp_before_add_to_mg

add_action(‘mlfp_before_add_to_mg’, ‘do_before_add_to_mg’);

Parameters

$attachment_id – ID of file to add
$attachment – Post object of the attachment
$gallery_id – ID of the destination gallery
$menu_order – next available free spot at the end of the gallery

function do_before_add_to_mg($attachment_id, $attachment, $gallery_id, $menu_order) {

}

mlfp_after_add_to_mg

add_action(‘mlfp_after_add_to_mg’, ‘do_after_add_to_mg’);

Parameters

$attachment_id – ID of file to add
$attachment – Post object of the attachment
$gallery_id – ID of the destination gallery
$menu_order – next available free spot at the end of the gallery

function do_after_add_to_mg($attachment_id, $attachment, $gallery_id, $menu_order);

mlfp_before_add_to_nextgen

add_action(‘mlfp_before_add_to_nextgen’, ‘do_before_add_to_nextgen’);

Parameters

$attachment_id – ID of the file
$image_location – image URL
$image_path – path to the image
$gallery_id – destination gallery
$gallery_location – location of gallery images

function do_before_add_to_nextgen($attachment_id, $image_location, $image_path, $gallery_id, $gallery_location) {

}

mlfp_after_add_to_nextgen

add_action(‘mlfp_after_add_to_nextgen’, ‘do_after_add_to_nextgen’);

Parameters

$attachment_id – ID of the file
$image_location – image URL
$image_path – path to the image
$gallery_id – destination gallery
$gallery_location – location of gallery images
$image_id – ID of image in Nextgen

function after_add_to_nextgen($attachment_id, $image_location, $image_path, $gallery_id, $gallery_location, $image_id) {

}

mlfp_before_upload_to_cloud

add_action(‘mlfp_before_upload_to_cloud’, ‘do_before_upload_to_cloud’);

Parameters

$location – relative location of the file
$filename – path to the file
$next_id

function do_before_upload_to_cloud($location, $filename, $next_id) {

}

mlfp_after_upload_to_cloud

add_action(‘mlfp_after_upload_to_cloud’, ‘do_after_upload_to_cloud’);

Parameters

$location – relative location of the file
$filename – path to the file
$next_id – current image ID
$sizes – array of thumbnail sizes

function do_after_upload_to_cloud($location, $filename, $next_id, $sizes) {

}

mlfp_before_download_from_cloud

add_action(‘mlfp_before_download_from_cloud’, ‘do_before_download_from_cloud’);

Parameters

$location – relative location of the file
$source_file – destination path
$attach_id – ID of the file
$remove – Remove from cloud (true or false)
$get_thumbnails download thumbnail images (true or false)

function do_before_download_from_cloud($location, $source_file, $attach_id, $remove, $get_thumbnails) {

}

mlfp_after_download_from_cloud

add_action(‘mlfp_after_download_from_cloud’, ‘do_after_download_from_cloud’);

Parameters

$location – relative location of the file
$source_file – destination path
$attach_id – ID of the file
$remove – Remove from cloud (true or false)
$get_thumbnails download thumbnail images (true or false)

function do_after_download_from_cloud($location, $source_file, $attach_id, $remove, $get_thumbnails) {

}