Filters

Our WP Cloud Plugins include a set of WordPress Filters designed to modify data before it is displayed or saved. Filters allow you to intercept and change plugin outputs or values, offering a flexible way to customize functionality. With these filters, you can adjust settings, content, or behavior in a seamless and efficient manner.

Slugs

The plugin provides several WordPress actions to hook into its functionality. These actions use a {slug} placeholder, which you should replace with the slug corresponding to your plugin variant:

  • shareonedrive for Share-One-Drive (OneDrive & SharePoint)

  • useyourdrive for Use-your-Drive (Google Drive)

  • outofthebox for Out-of-the-Box (Dropbox)

  • letsbox for Lets-Box (Box)

For example, the action {slug}_render_formfield_data(), which is applied when rendering a form submission in a form plugin entries overview, would be useyourdrive_after_module for Use-your-Drive.

Available filters

{slug}_render_formfield_data()

Fires after a module module has been rendered.

add_filter('useyourdrive_render_formfield_data', 'render_formfield_data', 10);

function render_formfield_data($data, $ashtml = true){

    // Read the array of files stored in the submission
    $uploaded_files = json_decode($data, true);
    
    // Continue if we aren't receiving any files
    if (empty($uploaded_files) || (0 === count($uploaded_files))) {
        return $data;
    }

    // Render a very basic list
    $formated_value = '';
    foreach ($uploaded_files as $file) {
        $formated_value .= basename($file['path'])." ({$file['size']})\r\n";
    }

    return $formated_value;
}

{slug}_apply_placeholders()

Replaces placeholders with values. You can add your own custom placeholders.

{slug}_is_entry_authorized()

Check to see if an item has the correct permissions to be displayed in the front end.

This information is still being completed...

Last updated