Skip Navigation

[Resolved] Split: relationship form – Is there a way to use custom placeholder text rather than "Search for a post":

This support ticket is created 4 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Michelle Dodd 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1647493

Tell us what you are trying to do?

The dropdown to connect many-to-many CPT relationships shows the CPTs in random order.

2. Is there a way to use custom placeholder text rather than "Search for a post"

hidden link
site password: collaborate
Try "Add EHR" to see the Relationship form

#1647497

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no GUI option available using which you can change the text "Search for a post".

You can use wordpress filter hook "gettext" to change it, for example:
- Add the following code to your current theme's functions.php file
OR
- You can add it to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/

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);

Where:
- change the string "My search for a post" as per your requirement.

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

#1647885

My issue is resolved now. Thank you!