Denis Yanchevskiy
Forum Replies Created
-
Forum: Plugins
In reply to: [DCO Comment Attachment] error display on my siteHello @nick897,
Can you provide a screenshot of what you have in line 80 and around it in the includes/class-dco-ca-admin.php file?
I don’t see anything in the plugin code that could cause this error.
Forum: Plugins
In reply to: [DCO Comment Attachment] How to add attachment via REST API?Just a note. This plugin is my pet project. So I’m developing it in my free time and can’t give a time frame for when the next version might come out. The third version is intended as a maintenance release to rethink the code and tidy things up, so I’ll be glad when it comes out too. But if you need REST API support in the near future, it will probably be more reliable to use what is available in the existing version.
By complex I meant that the plugin does not have built-in tools to add custom fields. So this task will require custom development. But if you are ready for it, then I think you will succeed πͺ
Forum: Plugins
In reply to: [DCO Comment Attachment] How to add attachment via REST API?Hello @turbodb,
Unfortunately, there is no documentation π .
About REST API. It’s a difficult question. REST API support was added several years ago and since then there have been no requests on this matter. Therefore, I don’t have a ready-made recipe now. I plan to deal with REST API in the next version.
Regarding the current version. Try to pass formData to body.
Something like this:
const formData = new FormData();
formData.append('post', postId);
formData.append('content', content);
formData.append('author_name', authorName);
formData.append('author_email', authorEmail);
formData.append('author_url', authorUrl);
formData.append('attachment', attachmentFile); // https://developer.mozilla.org/en-US/docs/Web/API/File
fetch(${wordpressUrl}/wp-json/wp/v2/comments, {
method: 'POST',
body: formData
})
.then (...)Hello @turbodb,
This looks like a complex task, so I think I can only give general recommendations.
You can try adding fields via the dco_ca_attachment_field filter or one of the filters from the form_element method.
Saving an attachment processed in the save_attachment method, but there are no hooks in it (maybe I’ll add something in the next version). Therefore, it is probably worth trying to find some hook in the media_handle_upload wp-function or, if that doesn’t work, try connecting to the attachment_id meta update. All these are workarounds and, apparently, not very convenient, but this is what came to my mind. So you can try to connect in this place and add additional information to the attachment from your fields.
About the output. DCO Comment Attachment saves attachments to the WordPress media library. So you can use any WordPress features to work with attachments. I don’t know if this will help, but here is the shortcode code for outputting attachments in the plugin.
Forum: Plugins
In reply to: [DCO Comment Attachment] Attachments not showing as “thumbnail” sizeThe next development version does not have this style at the moment.
Forum: Plugins
In reply to: [DCO Comment Attachment] Attachments not showing as “thumbnail” sizeHello @turbodb,
- Try applying these changesΒ to the DCO Comment Attachment plugin.
- After that, clear the cache in your browser.
Forum: Plugins
In reply to: [DCO Comment Attachment] DCO not showing up in my blogGreat! I’m glad everything worked as it should.
No, there is no donation link at the moment.
Forum: Plugins
In reply to: [DCO Comment Attachment] DCO not showing up in my blogTry clearing the cache in your browser.
Forum: Plugins
In reply to: [DCO Comment Attachment] DCO not showing up in my blogTry these steps.
Step 1. Add
enctype="multipart/form-data"to the form tag in the comments.php. Screenshot.Step 2. After that, apply these changes to the DCO Comment Attachment plugin.
Forum: Plugins
In reply to: [DCO Comment Attachment] DCO not showing up in my blogHello @shadislt,
Try to add
<?php echo apply_filters( 'comment_form_submit_field', '' ); ?>before the submit button, as in the screenshot, to the comments.php file of the Neonglow theme.Forum: Plugins
In reply to: [DCO Comment Attachment] Need updateHello @eli1994,
Please create a separate topic for your question and provide a link to the page with the issue. This makes navigation a lot easier. Thanks.
Forum: Plugins
In reply to: [DCO Comment Attachment] Need updateHello @mszaitsev,
Thank you for the bug report. I will fix it in the next version.
To fix it now, you can remove the problematic rule from the plugin’s stylesheet.
If it is ok for you, you need to remove this rule
.dco-image-attachment img {
width: auto !important;
height: auto !important;
}from the assets/dco-comment-attachment.css file. Line: 50.
I am attaching a screenshot to make it clearer.
After you remove the rule and clear the cache in your browser, you should get a result like this.
Forum: Plugins
In reply to: [DCO Comment Attachment] jQuery dependencyHello @back2music,
I plan to fix it in the next version.
As for fixing it now, I think the easiest way is to remove the jQuery dependency in the plugin code.
If this is ok for you, then you need to replace
wp_enqueue_script( 'dco-comment-attachment', DCO_CA_URL . 'assets/dco-comment-attachment.js', array( 'jquery' ), DCO_CA_VERSION, true );with
wp_enqueue_script( 'dco-comment-attachment', DCO_CA_URL . 'assets/dco-comment-attachment.js', array(), DCO_CA_VERSION, true );File: includes/class-dco-ca.php, line: 89.
https://github.com/yadenis/DCO-Comment-Attachment/blob/master/includes/class-dco-ca.php#L89
This should help.
Forum: Plugins
In reply to: [DCO Comment Attachment] Please add mp4 supportI tested it on this page https://mistresstissa.club/fixed/#comment-1811 and now video embedding works. Screenshot.
This is probably a conflict with the Html5 Video Player Pro plugin. I have not worked with this plugin and I don’t have any solution for this problem at the moment π . Maybe I can come up with something in future versions.
If you need this plugin, try contacting its support. Maybe they can offer some solution.