How to change the text displayed on 'create post'...
I would like to change the text to something more site specific for my site.
Currently is says 'Short title of this post' - then underneath 'What's happening (user name)'
also the text below that says 'posting in' where you select a space.
and 'choose up to 3 topics'
Where can this be changed?
Thanks
With almost any translate plugin. Such as Loco.
Tried Loco, no changed even after saving.
Found the pot file in launguage folder, made edits directly to the file... cleared cache, still no change on the front end...
If all else fails, hereβs a snippet you can use:
<?php
add_filter( 'gettext', 'reformedpub_customize_fc_labels', 10, 3 );
function reformedpub_customize_fc_labels( $translated_text, $text, $domain ) {
$user = wp_get_current_user();
// Try to get first name directly
$first = '';
if ( $user && $user->ID ) {
if ( ! empty( $user->first_name ) ) {
$first = $user->first_name;
} else {
// Fallback: split display_name
$parts = explode( ' ', trim( $user->display_name ) );
$first = $parts[0];
}
}
// 1. Title placeholder
if ( $text === 'Short title of this post' && $domain === 'fluent-community' ) {
return "Give this post a clear summary";
}
// 2. Main composer placeholder
if ( strpos( $text, "What's happening" ) !== false && $domain === 'fluent-community' ) {
return $first
? "What's on your mind, $first?"
: "What's on your mind?";
}
// 3. Space selector
if ( ( $text === 'Posting in:' || $translated_text === 'Posting in:' ) && $domain === 'fluent-community' ) {
return $first
? "Where would you like to post this, $first?"
: "Where would you like to post this?";
}
return $translated_text;
}
You can also change part 3 to this if you don't want to personalize it. Just replace from the comment all the way down:
// 3. Space selector
if ( ( $text === 'Posting in:' || $translated_text === 'Posting in:' ) && $domain === 'fluent-community' ) {
return 'Post in:';
}
return $translated_text;
}Jeff BrigmanΒ Gave this a go as nothing else seems to be working for me! This didnt have any effect either on my site...
Tim LordΒ you have to use the full php snippet I posted above.
I posted this question 5 months ago... I'm still hoping that someone can help. https://community.wpmanageninja.com/portal/space/community-meta/post/custom-placeholder-text
Jeremy RyanΒ I posted a code snippet above.
Jeff BrigmanΒ Thanks!
Jeff Brigman Forgive my very limited coding knowledge. I'm a small business owner, not a website wizard. π When attempting to implement your recommended code snippet, I notice 2 minor issues. I would be grateful for any additional suggestions.
1) I'm unable to use an apostrophe in the replacement text, as it seems to break the code. I would like the text to say "What's on your mind?", however that doesn't work. "What IS on your mind?" does work, so I assume it's because of the additional apostrophe. I would prefer the more conversational text , if possible. Thoughts?
2) The personalization is gone. The original placeholder text said "What's happening, Jeremy". Is it possible to keep the member's name in the replacement text? For example; "What's on your mind, Jeff?" Hoping this is possible.
Thank you in advance. I truly appreciate any guidance.
Jeremy RyanΒ in the car at the moment but you should be able to βescapeβ the apostrophe with a backslash (βWhat\βs on your mindβ). As for the member name, you need to pull that using one of the Fluent helper functions to get the profile, extract the name from the object, assign it to a variable, check that the value exists (not null), then concatenate it to the string (your text).
Sorry, I canβt remember the function name or the exact keys from the profile model off hand but if you give the developer docs (on GitHub) to an AI model with my instructions (with your snippet and requirements), it should easily provide you with the solution. If I have some time later today Iβll try get it working for you but Iβm not sure what time Iβll be in front of my computer.
Thanks Joshua Peterson The apostrophe dilemma is solved. Yay! I'll dig deeper into the member name concatenation. I appreciate your help. Cheers!
Jeremy RyanΒ Instead of escaping, wrap in quotes "What's on your mind, Jeremy?".
I've also updated the code above for personalization using first name with a fallback of username in the event of an issue.
Jeff BrigmanΒ The updated code worked great! Thank you very much for your help! πΊ Cheers!!
Managed to get Loco working... seems it was clashing with another plugin. Works fine now :-)
i change it by loco translate
