How to insert placeholder

Hello! Could you please advise how to insert placeholder in the following fields:

  1. On the create listing page, how to insert placeholder in the title and description?
  2. How to insert placeholder in geolocation field?
  3. How to insert placeholder in social links?

Hi,

Please try these PHP snippets (How to add custom code snippets - HivePress Help Center):

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		$form['fields']['description']['placeholder'] = 'custom text here';
		$form['fields']['title']['placeholder'] = 'custom text here';
		return $form;
	},
	1000
);
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if ( isset( $form['fields']['location'] ) ) {
			$form['fields']['location']['placeholder'] = 'custom text here';
		}

		return $form;
	},
	1000
);
  1. For example, if you select website social link, you can try this PHP snippet:
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		$form['fields']['website']['placeholder'] = 'custom text here';
	
		return $form;
	},
	1000
);

​I hope this is helpful to you.

1 Like

Thanks!

Item 1 worked, but 2 and 3 did not, I believe that due to the geolocation attributes and social links (website and instagram) being in the vendor registration form. Would I need to change anything in this code? Please could you let me know?

Hi,

Please ensure you add these PHP snippets using the Code Snippet plugin (How to add custom code snippets - HivePress Help Center).

Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, ensure that caching is disabled for logged-in users.

If this issue persists, please send temporary WP access to support@hivepress.io with details for reproducing this issue, and we’ll check it. You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.