Skip Navigation

[Resolved] change search for a post in relationship form

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1132833

Tell us what you are trying to do?

Relationship forms default text is "search for a post". I'd like to change that.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1133205

Hello,

There isn't such a built-in feature to change that text within UI.

You can use wordpress filter hook "gettext" to change it, for example:

add_filter('gettext', function($text, $org_text, $domain){
	if($text == 'Search for a post' && $domain == 'wp-cred'){
		$text = 'My search for a post';
	}
	return $text;
}, 10, 3);

More help:
https://developer.wordpress.org/reference/hooks/gettext/