• Resolved Haazi

    (@haazi)


    How can i add require to telephone number on add form?
    also i want to remove require email from same form. (i am totally controlling via telephone contact)
    please replay asap

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi, i sent you a reply via email, removing the email field is not possible (or rather it is possible but will break the [adverts_add] form), as for making the phone required you can add following code to your theme functions.php file to do that

    
    add_filter( "adverts_form_load", "customize_adverts_add" );
    function customize_adverts_add( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "adverts_phone" ) {
            $form["field"][$key]["validator"][] = array( "name" => "is_required" );
        }
      }
      return $form;
    }
    
    Thread Starter Haazi

    (@haazi)

    thanks for the fast reply.
    and another thing i didn’t ask to remove entire email field. i need to remover only require part of the email field
    is that possible ?

    Plugin Author Greg Winiarski

    (@gwin)

    I sent you a reply via email yesterday. I am closing this thread for now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Require to telephone’ is closed to new replies.