admin管理员组文章数量:1130349
I’ve tried to solve my problem all day now and hopefully someone can help me here.
This is my goal: Beeing able to edit and save files located in the uploads directory (for example wp-content/uploads/myplugin/style.css).
I already managed to create a site with a textarea that contains the code from the style.css. I did it this way:
<textarea><?php include([dynamic_path_to_file]) ?></textarea>
This is working fine. I also managed to integrate the codemirror-editor which is looking and working really nice.
Now I want to save the file after editing its content.
How can I do that?
I already tried some AJAX-Functions, for example as it is explained here:
I was also thinking of something like putting it in a form and send it somewhere on submit but I did not manage to get any good result.
If you can help me with my problem you’d really make my day.
Thank you in advance, Oliver!
I’ve tried to solve my problem all day now and hopefully someone can help me here.
This is my goal: Beeing able to edit and save files located in the uploads directory (for example wp-content/uploads/myplugin/style.css).
I already managed to create a site with a textarea that contains the code from the style.css. I did it this way:
<textarea><?php include([dynamic_path_to_file]) ?></textarea>
This is working fine. I also managed to integrate the codemirror-editor which is looking and working really nice.
Now I want to save the file after editing its content.
How can I do that?
I already tried some AJAX-Functions, for example as it is explained here: https://stackoverflow/questions/9543224/how-to-sending-php-code-from-codemirror-editor-via-jquery-ajaxpost-and-using-p
I was also thinking of something like putting it in a form and send it somewhere on submit but I did not manage to get any good result.
If you can help me with my problem you’d really make my day.
Thank you in advance, Oliver!
Share Improve this question asked Oct 18, 2018 at 15:00 OliverOliver 11 bronze badge1 Answer
Reset to default 0I got answer to that question in the wordpress-support-forum: https://wordpress/support/topic/overwrite-a-file-with-the-context-of-a-textarea/
I’ve tried to solve my problem all day now and hopefully someone can help me here.
This is my goal: Beeing able to edit and save files located in the uploads directory (for example wp-content/uploads/myplugin/style.css).
I already managed to create a site with a textarea that contains the code from the style.css. I did it this way:
<textarea><?php include([dynamic_path_to_file]) ?></textarea>
This is working fine. I also managed to integrate the codemirror-editor which is looking and working really nice.
Now I want to save the file after editing its content.
How can I do that?
I already tried some AJAX-Functions, for example as it is explained here:
I was also thinking of something like putting it in a form and send it somewhere on submit but I did not manage to get any good result.
If you can help me with my problem you’d really make my day.
Thank you in advance, Oliver!
I’ve tried to solve my problem all day now and hopefully someone can help me here.
This is my goal: Beeing able to edit and save files located in the uploads directory (for example wp-content/uploads/myplugin/style.css).
I already managed to create a site with a textarea that contains the code from the style.css. I did it this way:
<textarea><?php include([dynamic_path_to_file]) ?></textarea>
This is working fine. I also managed to integrate the codemirror-editor which is looking and working really nice.
Now I want to save the file after editing its content.
How can I do that?
I already tried some AJAX-Functions, for example as it is explained here: https://stackoverflow/questions/9543224/how-to-sending-php-code-from-codemirror-editor-via-jquery-ajaxpost-and-using-p
I was also thinking of something like putting it in a form and send it somewhere on submit but I did not manage to get any good result.
If you can help me with my problem you’d really make my day.
Thank you in advance, Oliver!
Share Improve this question asked Oct 18, 2018 at 15:00 OliverOliver 11 bronze badge1 Answer
Reset to default 0I got answer to that question in the wordpress-support-forum: https://wordpress/support/topic/overwrite-a-file-with-the-context-of-a-textarea/
本文标签: pluginsOverwrite a file with the content of a textarea
版权声明:本文标题:plugins - Overwrite a file with the content of a textarea 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749239867a2337899.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论