WORDPRESS: Send comments with attached images using Ajax for my pages.

Job ID: 32668018

Budget: $15 – $25 USD

I have a comment form where I have added a field “TITLE” and “IMAGE. These fields are available to both registered and non-registered users.

After following a tutorial on inserting fields and submitting it with AJAX:
https://rudrastyh.com/wordpress/ajax-comments.html

I managed to make the "Title" field submit using AJAX.

Create a file functions-comments.php where I put my php code and a file ajax-comment.js where I process the AJAX function (following the tutorial mentioned above).

What I cannot do is that the image of the "Image" field is uploaded to the server by AJAX and attached to the comment.

2. REQUIREMENTS:

2.1. Send via AJAX:
When the user submits the comment forms, the “Title”, “Comments” and “Image” information are sent by AJAX.

2.2. Order of form fields:
This is the order of the comment form fields:
- Title
- Comment
- Upload image
- Submit button.

2.3. The image must be viewable from the comments panel in the Wordpress Backend.

2.4 The image should be able to be removed from the comment panel in the Wordpress backend
When uploading an image, the script must generate 1 additional image (thumnail). That thumbnail must be displayed in the Wordpress backend and it has to be a 150 x 150 thumbnail.
But the image that is shown in the public part (List of comments in the Post), has to be the original (the one uploaded by the user).

2.6 The code must be in the theme and not through a plugin.

I managed to place and send the information by AJAX of the "title" field by placing my code in the file "functions-comments.php" and I believe that the same procedure should be for the image (highly recommended).


ADDITIONAL INFORMATION:

I have tried the “Comment Images Reloaded” plugin but it doesn't work with Ajax:
https://es.wordpress.org/plugins/comment-images-reloaded/

I have tried the “Comment Image” plugin but it doesn't work with Ajax:
https://es.wordpress.org/plugins/comment-image/

Both plugins have example code of what could be implemented (only example).


TEST DOMAIN:

I will give you access to a Wordpress in a real domain, to carry out the tests:

www.sonrisasonline.com/comentarios


PDT: Wordpress experts only
Related categories: PHP AJAX WordPress