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. Dealing with Many Meta Values, 30+
  9. ‘Add Media’ button doesn’t work when editor is initialized from javascript
  10. Why are there two diffrent full screen editors?
  11. How to set WYSIWYG editor width within wp_editor() function?
  12. Shortcode attribute escaping
  13. Add a wp editor to custom plugin and save data
  14. wp_editor not adding paragraphs despite wpautop being set to true
  15. How to delete outdated, wrongly sized images in _wp_attachment_metadata?
  16. Meta keywords and descriptions plugin for manually editing meta for each page/post
  17. WP Editor strips input placeholder attribute
  18. Manipulating post meta in the customizer
  19. Custom editor field displaying HTML in Visual editor
  20. How to remove the “Path” line in the WordPress Editor for end users who are submitting a form?
  21. TinyMCE style_select – Append Classes
  22. Remove specific buttons from wp_editor()
  23. How to customize default wordpress editor?
  24. WP Editor does not Initialize Correctly When Form Elements are Removed from the DOM
  25. Updating post meta for custom post types
  26. Having trouble with custom post type / meta box
  27. ajax delete value from custom field array
  28. Auto-resize when writing with Custom post WP editor
  29. Changing the default WP editor font and size
  30. WP_Editor – Setting render location on page
  31. Hide post meta data on a specific category
  32. How to pass the wp_editor content using jquery
  33. How do I prevent the wp_editor from loading outside container?
  34. Custom Post Type, Saving Multiple Checkboxes
  35. Gutenberg – Custom blocks not working as expected?
  36. Quotes being escaped inside wp_editor when saved with wp_kses_post
  37. Custom search for custom post meta with pre_get_posts interferes with WP search
  38. Save wp_editor() content as option
  39. How to remove buttons from the WP Editor on the edit post page in the admin area
  40. Using WYSIWYG In custom meta boxes
  41. Change the name of the wp_editor tab “html/text”
  42. Updating post content on the front end
  43. Target wp_editor buttons to add a tooltip
  44. Using default wordcount javascript in WordPress on custom wp_editor() areas
  45. Access post meta in future_to_publish function
  46. changing meta value and meta key of price field
  47. Add a date updated/date modified option using custom fields
  48. Get Custom Logo Alt Text
  49. wpautop is not working when displaying content saved using wp_editor in a custom meta box
  50. Removing line breaks when in text view with wp_editor
  51. How to add custom button in wp_editor
  52. Edit Page blank
  53. how to set max-length at the wp_editor
  54. result from custom filter admin table list backend does not work
  55. Update postmeta Parent when post_status child change
  56. Attaching taxonomy data to taxonomy with wp_insert_post
  57. Like to convert textarea into using wp_editor
  58. Add default page editor to an admin settings page
  59. Getting value from get_post_custom
  60. Can I use wp_editor() to create a second instance of the editor in my post page?
  61. echo a specific meta_key queried through a custom post
  62. Calling Different Custom Post Timestamps in a table
  63. How would I load wp_editor someehere else other than the admin area?
  64. wp_editor not modify html tags of initial content
  65. Custom query, multiple custom keys
  66. wp.editor.initialize not working as expected
  67. How can I apply preventDefault() to the click on CodeMirror-hints?
  68. How to Disable option of meta field if that option is selected for any other post in custom post type?
  69. WordPress editor issues
  70. Remove distraction free mode from teeny editor
  71. automatically apply clear formating when pasting text on editor
  72. Stored meta from attachment, video length?
  73. WordPress textual editor problem with new line
  74. WordPress delete mysql rows with string
  75. Still desperate about multiple TinyMCEs in widgets – is there any good solution to this yet?
  76. Use ENTER, not SHIFT+ENTER to Insert Line Break in WP editor
  77. How to replace textarea in plugin with wp_editor
  78. How to create 2 preview button in a post?
  79. Is there a way to install a drop-down with all site pages in WP-Editor?
  80. wp_editor returning invalid html
  81. Adding text above the editor
  82. Embed and word Count not working for wp_editor instance
  83. How to make this clean?
  84. echo wp_editor to screen with formatting
  85. When post is updated, custom metadata in text area field is overwritten
  86. wp_editor saving to database, but not displaying content on refresh
  87. How to stop wp-editor() overwriting my HTML?
  88. ThinkTanking for design [closed]
  89. Wp_editor bug with foreach()?
  90. Adding custom fields to images
  91. Convert textarea into TinyMCE
  92. load wp_editor without wp_footer
  93. How can I open WP rich editor within colorbox in the front end?
  94. Select Options Meta Data is Not Updating in Edit Meta Box
  95. front post submit using wp_editor
  96. Why am I not able to save / update data in wp_editor?
  97. How edit footer copyright info? [closed]
  98. Replacing a textarea in post meta with wp_editor() WordPress
  99. How to edit the Page?
  100. Multiple wp.editor in a custom widget using JQuery
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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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