Title: Call Custom Node to Function Editor
Last modified: November 11, 2018

---

# Call Custom Node to Function Editor

 *  Resolved [Omi](https://wordpress.org/support/users/dekzgimutao/)
 * (@dekzgimutao)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/call-custom-node-to-function-editor/)
 * Hi I’m uploading to a custom directory for all the import but structure was a
   bit different
 * I want the uploads directory to be:
 * [https://my-website.com/wp-content/uploads/my_uploads/user_uploads/$user_id/sample-file.pdf](https://my-website.com/wp-content/uploads/my_uploads/user_uploads/$user_id/sample-file.pdf)
 * where $user_id was a specific node inside the import file called {createdbyuserid[
   1]} or createdbyuserid[1]
 * I can make the import using the action reference from github, but how would we
   hook a specific node createdbyuserid[1] inside the $user_id variable? is it possible?
 * $user_id = node[1] or
    $user_id = createdbyuserid[1]
 * Can we place a specific node inside a variable in functions editor?
 * At current it was only making the $user_id path as /1/
 * I used the structure codes based on the github action-reference
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/call-custom-node-to-function-editor/#post-10888689)
 * Hi [@dekzgimutao](https://wordpress.org/support/users/dekzgimutao/)
 * When using the ‘wp_all_import_attachments_uploads_dir’ hook (see: [https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-import/wp_all_import_attachments_uploads_dir.php](https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-import/wp_all_import_attachments_uploads_dir.php)),
   you can access the {createdbyuserid[1]} element like so:
 *     ```
       add_filter('wp_all_import_attachments_uploads_dir', 'wpai_wp_all_import_attachments_uploads_dir', 10, 4);
   
       function wpai_wp_all_import_attachments_uploads_dir($uploads, $articleData, $current_xml_node, $import_id){
   
               // Get user ID from element
       	$user_id = $current_xml_node['createdbyuserid'];
   
       	// Here, you'll edit the $uploads array
   
       	// Now, return the new array.
       	return $uploads;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Call Custom Node to Function Editor’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

## Tags

 * [custom path](https://wordpress.org/support/topic-tag/custom-path/)

 * 1 reply
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/call-custom-node-to-function-editor/#post-10888689)
 * Status: resolved