Join our new community forum for support & discussion

Join Now

Home Support Themes RentalHive Add instructions to fields

Add instructions to fields

  • Author
    Posts
  • DianaLizarazo

    Hi! Yevhen or Ihor,

    I have a question, I want to add specific instructions in the fields: Add profile description and add service description. So right below the title of those fields, I can explain further what exactly they need to write in that field. Is this possible to add?

    Thanks!

    yevhen developer

    Sure. You can try to add description to fields in this way https://gist.github.com/hivepress/2465d4e827fdef0fbcb0dd8d156ab997
    You should just change field name in this way $form['fields']['field_name']['description'] and form name in the hook hivepress/v1/forms/form_name_here

    If you need more help then please clarify on which form you want to make changes and what fields

    DianaLizarazo

    HI Yevhen,

    As I mentioned before, I want to add these instructions in the
    1) Profile description of HOSTs only
    2) Listing description

    I am not sure if like below is appropriate. Can you please confirm? Also, I am not sure if where it says “custom text here”, should I write what I want to add right in the snippet.

    add_filter(
    ‘hivepress/v1/forms/listing_submit’,
    function( $form ) {
    $form[‘fields’][‘description’][‘description’] = ‘custom text here’;

    return $form;
    },
    1000
    );

    add_filter(
    ‘hivepress/v1/forms/registration_submit’,
    function( $form ) {
    $form[‘fields’][‘description’][‘description’] = ‘custom text here’;

    return $form;
    },
    1000

    DianaLizarazo

    okay, I managed to do it for the listing 🙂 So Thanks!

    But is not working for the profile. So I want to add a description for the profile description field
    1) for normal users registration
    2) for hosts registrations and updates of their profiles (so i can add more specific information to them)

    Below was what I did and did not work.

    add_filter(
    	'hivepress/v1/forms/registration_submit',
    	function( $form ) {
    		$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    
    		return $form;
    	},
      1000
    );
    
    add_filter(
    	'hivepress/v1/forms/profile_update',
    	function( $form ) {
    		$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    
    		return $form;
    	},
      1000
    );
    ihor developer

    Please try using this one instead:

    add_filter(
    	'hivepress/v1/forms/user_update',
    	function( $form ) {
    		$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    
    		return $form;
    	},
      1000
    );
    DianaLizarazo

    Amazing!

    Thank you 🙂

    However, I still wonder if its possible to have specific description details only for hosts. Because I assume this snippet applies to both hosts and customers.

    Thanks!

    ihor developer

    Please try this one for the vendor profile form only:

    add_filter(
    	'hivepress/v1/forms/user_update_profile',
    	function( $form ) {
    		$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    
    		return $form;
    	},
      1000
    );
    DianaLizarazo

    No, it did not work. The description I added previously stayed in the field. Any other ideas?

    yevhen developer

    Please make sure that you use only this code snippet. In this case the field description will be added for the vendor profile form only:

    add_filter(
    	'hivepress/v1/forms/user_update_profile',
    	function( $form ) {
    		$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    
    		return $form;
    	},
      1000
    );
    DianaLizarazo

    No, again, it did not work. I removed the previous snippet and activated this but now I do not even have the basic description I had before. I want this to appear when hosts update-edit their profiles and so far, it is not working.

    yevhen developer

    Please try this PHP snippet

    add_filter(
    	'hivepress/v1/forms/user_update_profile',
    	function( $form ) {
    		$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    
    		return $form;
    	},
      1000
    );
    
    add_filter(
    	'hivepress/v1/forms/user_update',
    	function( $form ) {
    		if(current_user_can('edit_posts')){
    			$form['fields']['description']['description'] = '1) Menciona quien eres y a que te dedicas 2)Menciona tus intereses y/o las razones por las que estás aqui';
    		}
    		
    		return $form;
    	},
      1000
    );
    DianaLizarazo

    Hi Yevhen,

    I really appreciate your intention to help. However, it does not work.

    This snippet is definitely not working:

    add_filter(
    ‘hivepress/v1/forms/user_update_profile’,
    function( $form ) {
    $form[‘fields’][‘description’][‘description’] = ‘1) Menciona quien eres, tu titulo universitario,y especialidad. 2)Menciona tu experiencia profesional y/o cursos, voluntariados o actividades extracurrulares en las que participaste relacionadas a la psicologĂ­a. 3)Menciona tus logros y habilidades más importantes en el campo. 4)Menciona otro tipo de habiliades que posees y consideras son importantes para los usuarios. 5)Finaliza con una frase que resalte por que los usuarios deberĂ­an tomar tus servicios.’;

    return $form;
    },
    1000
    );

    yevhen developer

    Please make sure that it is added correctly. It seems to be ok when tested locally (for both the Complete Profile and Settings forms)
    https://prnt.sc/pc6YHrTbxXtr
    https://prnt.sc/M9OglPCTdf4Z

Viewing 13 posts - 1 through 13 (of 13 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.