The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] Image upload not available on Custom Post Type comment form
(@nomadnathan)
New Member
Joined: 5 years ago
Hello!
We are using WpDiscuz on our Wordpress website, without the file upload additional plugin.
On wp posts, the form display the icon on the right side of the toolbar to allow the user to add a media in his comment.
On our CPT, this icon/feature is not displayed.
(The CPT support in enable on the settings and the comment form is displayed on the CPT page).
Is it a bug? What could we do?
Thanks a lot in advance,
Nathan
(@dinevarad)
Joined: 5 years ago
New Member
Posts: 1
Jun 30, 2020 9:06 am
Hello!
We are using WpDiscuz on our Wordpress website, without the file upload additional plugin.
On wp posts, the form display the icon on the right side of the toolbar to allow the user to add a media in his comment.
On our CPT, this icon/feature is not displayed.
(The CPT support in enable on the settings and the comment form is displayed on the CPT page).
Is it a bug? What could we do?
Thanks a lot in advance,
Nathan
Hi
In \wp-content\plugins\wpdiscuz\utils\class.WpdiscuzHelperUpload.php
Change code
public function isUploadingAllowed($postObj = null) { global $post; $gPost = $postObj ? $postObj : $post; $isAllowed = false; if ($this->isAllowedPostType($gPost) && !empty($this->options->content["wmuMimeTypes"])) { $currentUser = WpdiscuzHelper::getCurrentUser(); $isUserLoggedIn = !empty($currentUser->ID); $isGuestAllowed = !$isUserLoggedIn && $this->options->content["wmuIsGuestAllowed"]; $isUserAllowed = $isUserLoggedIn && $this->canUserUpload($currentUser); if ($isGuestAllowed || $isUserAllowed) { $isAllowed = true; } } return $isAllowed; }
to
public function isUploadingAllowed($postObj = null) { global $post; $gPost = $postObj ? $postObj : $post; $isAllowed = false; if ($this->isAllowedPostType($gPost) && !empty($this->options->content["wmuMimeTypes"])) { $currentUser = WpdiscuzHelper::getCurrentUser(); $isUserLoggedIn = !empty($currentUser->ID); $isGuestAllowed = !$isUserLoggedIn && $this->options->content["wmuIsGuestAllowed"]; $isUserAllowed = $isUserLoggedIn && $this->canUserUpload($currentUser); if ($isGuestAllowed || $isUserAllowed) { $isAllowed = true; } } return 1; }
(@asti)
Illustrious Member
Joined: 8 years ago
Hi @nomadnathanm,
As it's already mentioned here , t he default "Attach an image" button is only available for the post , pages , and attachments post types, and for defau lt Wordpress user roles . For custom post types and custom user roles, the button is not accessible. For more advanced features, we recommend to check out the wpDiscuz Media Uploader add-on.
(@nomadnathan)
New Member
Joined: 5 years ago
Hi @Asti , thank you for your quick reply, we will purchase and use the Media Uploader add-on.