Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Save values from foreach loop in wp_editor

wp_editor function accepts (array) $settings param and that one can contain textarea_name as a key. If it’s not being specified, it’s set by default as $editor_id. See: https://github.com/WordPress/WordPress/blob/c392ff6f90d550bad876d8a984ad6b3b8a49cd96/wp-includes/class-wp-editor.php#L44

So you might want to do something like this:

foreach ($get_url as $list) {
    ...
    $settings = array( 'textarea_name' => 'uploaded_csv[]' );
    ...
    wp_editor( $link, $editor_id, $settings );
    ...
}

And in your saving function, you simply loop over the $_POST['uploaded_csv'] array

function save_wp_editor_fields(){
    global $post;
    foreach ( $_POST['uplaoded_csv'] as $key => $uploaded_csv ) {
        update_post_meta($post->ID, 'my_uploaded_csv_'.$key, $uploaded_csv);
    }
}

Of course you should figure out the uniqueness of the created meta (eg. giving it a number or handle more meta keys per post with non unique name. See http://codex.wordpress.org/Function_Reference/add_post_meta).

Hope this helps a bit!

Related Posts:

  1. what is the correct way to compare dates in a WP query_posts meta_query
  2. Explanation of update_post_(meta/term)_cache
  3. Attaching taxonomy data to post with wp_insert_post
  4. wp_editor textarea value not updating
  5. Correctly delete posts with meta and attachments [duplicate]
  6. Sanitize content from wp_editor
  7. Show Font Awesome Icons In WP Post Editor
  8. ‘Add Media’ button doesn’t work when editor is initialized from javascript
  9. Why are there two diffrent full screen editors?
  10. How to set WYSIWYG editor width within wp_editor() function?
  11. Shortcode attribute escaping
  12. wp_editor not adding paragraphs despite wpautop being set to true
  13. Meta keywords and descriptions plugin for manually editing meta for each page/post
  14. WP Editor strips input placeholder attribute
  15. How to remove the “Path” line in the WordPress Editor for end users who are submitting a form?
  16. TinyMCE style_select – Append Classes
  17. Remove specific buttons from wp_editor()
  18. How to customize default wordpress editor?
  19. WP Editor does not Initialize Correctly When Form Elements are Removed from the DOM
  20. Having trouble with custom post type / meta box
  21. Auto-resize when writing with Custom post WP editor
  22. WP_Editor – Setting render location on page
  23. Hide post meta data on a specific category
  24. Custom Post Type, Saving Multiple Checkboxes
  25. Gutenberg – Custom blocks not working as expected?
  26. Quotes being escaped inside wp_editor when saved with wp_kses_post
  27. Custom search for custom post meta with pre_get_posts interferes with WP search
  28. How to remove buttons from the WP Editor on the edit post page in the admin area
  29. Using WYSIWYG In custom meta boxes
  30. Change the name of the wp_editor tab “html/text”
  31. Updating post content on the front end
  32. Using default wordcount javascript in WordPress on custom wp_editor() areas
  33. Access post meta in future_to_publish function
  34. changing meta value and meta key of price field
  35. Add a date updated/date modified option using custom fields
  36. Get Custom Logo Alt Text
  37. wpautop is not working when displaying content saved using wp_editor in a custom meta box
  38. Removing line breaks when in text view with wp_editor
  39. How to add custom button in wp_editor
  40. Edit Page blank
  41. how to set max-length at the wp_editor
  42. result from custom filter admin table list backend does not work
  43. Attaching taxonomy data to taxonomy with wp_insert_post
  44. Like to convert textarea into using wp_editor
  45. Add default page editor to an admin settings page
  46. Can I use wp_editor() to create a second instance of the editor in my post page?
  47. Calling Different Custom Post Timestamps in a table
  48. How would I load wp_editor someehere else other than the admin area?
  49. wp_editor not modify html tags of initial content
  50. Custom query, multiple custom keys
  51. wp.editor.initialize not working as expected
  52. Uknown meta entries in wp_postmeta
  53. cleaning up safely wordpress wp_postmeta table
  54. wp-editor is empty on first submit
  55. How WordPress remembers which active editing modes are used?
  56. how to display wp_editor in a page
  57. Customize rel=canonical tag for single blog post
  58. Hide post title input for all roles except admin
  59. wp_editor visual tab in meta box doesn’t show content
  60. if in category but only with post meta
  61. how to save wp_editor html content in options table
  62. wp_editor doesn’t save styling
  63. How to use wordpress text editor in php page
  64. Orderby two meta fields not working
  65. textarea_name is not working with wp_editor
  66. Simple Custom Metabox Not Saving
  67. How Can i print the wp_editor field content?
  68. remove a single post_meta
  69. How to add set featured image button in wp_editor()?
  70. WP_editor problem
  71. Best way to achieve multiple links in a post title
  72. Link Posts to External URL
  73. Displaying content on the website frontend that was uploaded using wp_editor?
  74. Free Alternate WordPress Editor (without requiring plugins)
  75. How to bulk Update URLs to new values?
  76. Delete post meta by serialized meta value
  77. Bold button gets unchecked on enter click when bullet button is also selected in WP Editor
  78. Include Recent Post in Category
  79. How can I apply preventDefault() to the click on CodeMirror-hints?
  80. How to Disable option of meta field if that option is selected for any other post in custom post type?
  81. WordPress editor issues
  82. Remove distraction free mode from teeny editor
  83. Stored meta from attachment, video length?
  84. WordPress textual editor problem with new line
  85. Use ENTER, not SHIFT+ENTER to Insert Line Break in WP editor
  86. How to replace textarea in plugin with wp_editor
  87. Is there a way to install a drop-down with all site pages in WP-Editor?
  88. wp_editor returning invalid html
  89. Adding text above the editor
  90. How to make this clean?
  91. When post is updated, custom metadata in text area field is overwritten
  92. Wp_editor bug with foreach()?
  93. Adding custom fields to images
  94. Convert textarea into TinyMCE
  95. How can I open WP rich editor within colorbox in the front end?
  96. Select Options Meta Data is Not Updating in Edit Meta Box
  97. front post submit using wp_editor
  98. Why am I not able to save / update data in wp_editor?
  99. How edit footer copyright info? [closed]
  100. Replacing a textarea in post meta with wp_editor() WordPress
Categories wp-editor Tags customization, post-meta, wp-editor
Loop doesn’t display posts. It displays a link to the home page instead
Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress