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
Include post title ...
 
Notifications
Clear all

[Solved] Include post title in comment join text

6 Posts
2 Users
1 Reactions
1,524 Views
 Jave
(@jave)
Posts: 15
Eminent Member
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
 
[#3874]

Hello,

 

is there a way to include the post title inside the comment join text (the placeholder)? 

 

I would like to change it dynamically according to the current post to something like:

 

"What are your thoughts about 'post title' ?" 

 

Maybe this is archivable with a simple snippet? 

 

Thanks in advance. 


 
Posted : 10/04/2022 3:47 am
 Jave
(@jave)
Posts: 15
Eminent Member
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
 

Got it working with this:

 

add_filter("wpdiscuz_phrase", function ($phrase, $key, $args) {
    if ($key === "wc_comment_join_text") {
	$title = get_the_title(get_queried_object_id());
        $phrase = str_replace("Kommentar", "What are your thoughts about $title ?" , $phrase);
    }
    return $phrase;
}, 10, 3);

 

But now there results another question out of it: As the placeholder is the same like in reply to textarea it doesn't fit anymore. How can I hide the placeholder only in reply to form but keep it in the main comment form?


 
Posted : 10/04/2022 6:46 pm
Asti
 Asti
(@asti)
Posts: 8262
Illustrious Member 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
 

@jave,

You can use the CSS code: 

#wpdcom form.wpd_comm_form.wpd-secondary-form-wrapper .ql-editor::before{ 
    display: none;
}

Put the code in the Top Admin Bar > Customize > Additional CSS > "Additional CSS" textarea, save it, delete all caches and check again.


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 11/04/2022 11:39 am
 Jave
(@jave)
Posts: 15
Eminent Member
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
 

Thanks, working! Last question: Is it also possible to change the submit button text only for replies?


 
Posted : 11/04/2022 1:50 pm
Asti
 Asti
(@asti)
Posts: 8262
Illustrious Member 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
 

@jave,

You should use some JS code like this: 

jQuery(document).ready(function(){
      jQuery('#wpdcom #wpdiscuz_hidden_secondary_form input[type="submit"]').attr("value", "Your text");
});

This article should be helpful for you: https://www.collectiveray.com/add-javascript-to-wordpress

Change the red marked value as you like. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 11/04/2022 2:40 pm
 Jave
(@jave)
Posts: 15
Eminent Member
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
 

Great, thanks alot. Everything solved! 🙂


 
Posted : 11/04/2022 6:04 pm
Asti reacted