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
✦ Summarize Topic
✦
✦
✦
AI is analyzing the discussion...
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Jun 19, 2020 12:59 pm
(@nomadnathan)
New Member
Joined: 6 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: 6 years ago
New Member
Posts: 1
Jun 30, 2020 1:06 pm
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
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; }
Support
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Jun 19, 2020 1:05 pm
(@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.
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Jun 20, 2020 4:24 pm
(@nomadnathan)
New Member
Joined: 6 years ago
Hi @Asti , thank you for your quick reply, we will purchase and use the Media Uploader add-on.