WP Cloud Plugins
PluginsPlayground ↗⏵ Open Ticket
  • Getting Started
    • System Requirements
    • Installation
    • Connect a Cloud Account
    • Add your First Module
    • How to Update?
  • Licensing
    • Activate License
    • Deactivate/Move license
    • Local/Staging sites
    • License FAQ
  • Global Options
    • Layout
    • Personal Folders
    • Review & Approve
    • Integrations
    • Notifications
    • Permissions
    • Usage Limits
    • Security
    • Advanced
    • Statistics
    • Tools
  • Modules
    • Module Manager
    • Module Configurator
      • Content
      • Accessibility
      • Dynamic Folders
      • Actions
      • Review & Approve
      • Layout
      • Sort Order
      • Filters
      • Upload Settings
      • Usage Limits
      • Notifications
    • Modules
      • Audio player
      • Button
      • Embed
      • File Browser
      • Gallery
      • List
      • Review & Approve
      • Search Box
      • Slider / Carousel
      • Upload Box
      • Video player
  • Features
    • Dynamic Folders
      • Automatic mode
      • Manual mode
    • Personal Folders
      • FAQs
    • Embed documents
    • Import to Media Library
    • Video Advertisements
    • Statistics
    • Webhooks
  • Integrations
    • Advanced Custom Fields (ACF)
    • Form Plugins
      • Contact Form 7
      • Fluent Forms
      • Formidable Forms
      • Gravity Forms
      • GravityPDF
      • NinjaForms
      • WPForms
    • Page Builders
      • Beaver Builder
      • Classic Editor
      • Divi Page Builder
      • Gutenberg
      • Elementor
    • Slack
    • Uncanny Automator
    • WooCommerce
      • Digital Downloads
      • Order Uploads
    • Easy Digital Downloads (EDD)
  • Developers
    • Actions
    • API
      • copy()
      • copy_folder_recursive()
      • create_folder()
      • create_edit_url()
      • create_preview_url()
      • create_shared_url()
      • create_temporarily_download_url()
      • delete()
      • download()
      • get_entry()
      • get_folder()
      • move()
      • patch()
      • rename()
      • set_account_by_id()
      • set_drive_by_id()
      • upload_file()
    • Filters
    • Placeholders
  • Other
    • FAQs
    • Translations
    • Vulnerabilities
    • Support
      • Scope
      • Open a Support Ticket
    • About Us
    • Changelog
Powered by GitBook
On this page
  1. Developers
  2. API

create_folder()

Create new folder

create_folder()

This method will create a new folder in the cloud.

Parameters

Name
Type
Description

$new_name

string

The name of the folder to be created.

$parent_id

string

ID of the folder where the new folder should be created.

Return

Name
Type
Description

$node

CachedNode

The cached object for the new created folder.

Usage

WPCP_ONEDRIVE_API::set_account_by_id('8c9bacda0-d8d8-4b22-b634-7b5281687575');
WPCP_ONEDRIVE_API::set_drive_by_id('b!DlaHWskCed_MIid3KpJH5Lbatf9HsdXBAZH5YcvPAbMhJUKzTJyzgvXZYpBS');

// Create a new folder
$node = WPCP_ONEDRIVE_API::create_folder('Documents', '01EXLSWHRCD7RDL3HX65BK5X3ULXLWSICN');

Parameters

Name
Type
Description

$new_name

string

The name of the folder to be created.

$parent_id

string

ID of the folder where the new folder should be created.

Return

Name
Type
Description

$node

CachedNode

The cached object for the new created folder.

Usage

WPCP_GDRIVE_API::set_account_by_id('201096615285735764133')

$node = WPCP_GDRIVE_API::get_folder('1FCYkOJb150I8nl8DE92YIXWaB0J7VOk5');

$node->get_name();

foreach ($node->get_children() as $id => $entry_node) {
  $entry_node->get_name();
}

Parameters

Name
Type
Description

$new_name

string

The name of the folder to be created.

$target_folder_path

string

The folder path where the new folder should be created

($params)

array

Additional Parameters. Use ['autorename' => true] to automatically rename the folder if a folder with the same name already exists.

Return

Name
Type
Description

$entry

Entry

The object for the new folder.

Usage

WPCP_DROPBOX_API::set_account_by_id('dbid:AADSy6JxzbgqCs4A43CAAAfO9xvZwpcsLU');

// Create a new folder
$entry = WPCP_DROPBOX_API::create_folder('Documents', '/Path/to/Client/Folder');

Parameters

Name
Type
Description

$new_name

string

The name of the folder to be created.

$parent_id

string

ID of the folder where the new folder should be created.

Return

Name
Type
Description

$node

CachedNode

The cached object for the new created folder.

Usage

WPCP_BOX_API::set_account_by_id('29232154182');

// Create a new folder
$node = WPCP_BOX_API::create_folder('Documents', '511426724354');

Previouscopy_folder_recursive()Nextcreate_edit_url()

Last updated 6 months ago