> For the complete documentation index, see [llms.txt](https://wpcloudplugins.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wpcloudplugins.gitbook.io/docs/developers/api/move.md).

# move()

## Move files and folders

&#x20; <mark style="background-color:orange;">move()</mark> &#x20;

This method will move items to a new location.

{% tabs %}
{% tab title="OneDrive" %}

### **Parameters**

<table><thead><tr><th width="192">Name</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$entry_ids</code></td><td>array</td><td>ID of the entries that should be moved.</td></tr><tr><td><code>$target_id</code></td><td>string</td><td>ID of the folder where the entry should be moved to.</td></tr></tbody></table>

### **Return**

<table><thead><tr><th width="194">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$nodes</code></td><td><strong>CachedNode[]</strong></td><td>An array of objects for the moved files/folders.</td></tr></tbody></table>

### **Usage**

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

$entry_ids = [
  '01EXLSWHWMQZNDMLRG7NFIWAVYCFJAXP2R',
  '01EXLSWHW3APNASPERAVGJEAVQAMUNIKF6'
];

$nodes = WPCP_ONEDRIVE_API::move($entry_ids, '01EXLSWHRCD7RDL3HX65BK5X3ULXLWSICN');
```

{% endtab %}

{% tab title="Google Drive" %}

### **Parameters**

<table><thead><tr><th width="184">Name</th><th width="88">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$entry_ids</code></td><td>array</td><td>ID of the entries that should be moved.</td></tr><tr><td><code>$target_id</code></td><td>string</td><td>ID of the folder where the entry should be moved to.</td></tr></tbody></table>

### **Return**

<table><thead><tr><th width="184">Name</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$nodes</code></td><td><strong>CachedNode[]</strong></td><td>An array of objects for the moved files/folders.</td></tr></tbody></table>

### **Usage**

```php
WPCP_GDRIVE_API::set_account_by_id('201096615285735764133')

$entry_ids = [
  '1wzWlDMsZkA4N5yEEAmMigp52u7M0Lk_7',
  '1w7wpGF9jo4ZDmFaXxoBRDbCnotCmypJZ'
];

$nodes = WPCP_GDRIVE_API::move($entry_ids, '1FCYkOJb150I8nl8DE92YIXWaB0J7VOk5');
```

{% endtab %}

{% tab title="Dropbox" %}

### **Parameters**

<table><thead><tr><th width="152">Name</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$request</code></td><td>array</td><td>An array with 'path' keys. Path can both be an ID or a actual path.</td></tr></tbody></table>

### **Return**

<table><thead><tr><th width="150">Name</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$entries</code></td><td><strong>Entry[]</strong></td><td>An array of objects for the moved files/folders.</td></tr></tbody></table>

### **Usage**

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

$request = ['entries' =>  []];

$request['entries'][] = ['from_path' => '/Homework/math', 'to_path' => '/Homework/algebra'];
$request['entries'][] = ['from_path' => '/Documents/a picture.jpg', 'to_path' => '/Documents/just a picture.jpg'];

$entries = WPCP_DROPBOX_API::move($request);
```

{% endtab %}

{% tab title="Box" %}

### **Parameters**

<table><thead><tr><th width="209">Name</th><th width="96">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>$id</code></td><td>string</td><td>ID of the entry that should be moved.</td></tr><tr><td><code>$new_parent_id</code></td><td>string</td><td>ID of the folder where the entry should be moved to.</td></tr><tr><td><code>$is_dir</code></td><td>bool</td><td>Is the entry a folder or a file?</td></tr></tbody></table>

### **Return**

| Name    | Type           | Description                                  |
| ------- | -------------- | -------------------------------------------- |
| `$node` | **CachedNode** | The cached object for the moved file/folder. |

### **Usage**

```php
WPCP_BOX_API::set_account_by_id('29232154182');

$node = WPCP_BOX_API::move('51142665', '511426724354', false);
```

{% endtab %}
{% endtabs %}
