The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Image upload not av...
 
Share:
Notifications
Clear all

[Solved] Image upload not available on Custom Post Type comment form

4 Posts
3 Users
0 Reactions
2,233 Views
Posts: 2
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
(@nomadnathan)
New Member
Joined: 6 years ago
[#426]

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.

FireShot Capture 169   test analyse   Union Trader   union trader.com

 

On our CPT, this icon/feature is not displayed.

FireShot Capture 168   500014 BSE – Union Trader   union trader.com

(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


3 Replies
1 Reply
(@dinevarad)
Joined: 6 years ago

New Member
Posts: 1
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
Posted by: @nomadnathan

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.

FireShot Capture 169   test analyse   Union Trader   union trader.com

 

On our CPT, this icon/feature is not displayed.

FireShot Capture 168   500014 BSE – Union Trader   union trader.com

(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
Posts: 8208
 Asti
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
(@asti)
Illustrious Member
Joined: 8 years ago

 Hi @nomadnathanm,

As it's already mentioned here, the default "Attach an image" button is only available for the postpages, and attachments post types, and for default Wordpress user rolesFor 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.


Posts: 2
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
(@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.


Share: