• Resolved jewelryme

    (@jewelryme)


    Hi

    This plugin is great. I’m almost done with my website and I just need to make the following into the add and edit form:
    1. remove phone and location fields (or hide them)
    2. make price required.

    Can you please help me?

    Thank you!

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

    (@gwin)

    Hi, you can do that by adding the code below in your theme functions.php file

    
    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" ) {
            unset( $form["field"][$key] );
        }
        if( $field["name"] == "adverts_location" ) {
            unset( $form["field"][$key] );
        }
      }
      return $form;
    }
    

    The price cannot be made required right now due to the currency filter it is using, the filter will make the field always look like filled (at least with “0”).

    Thread Starter jewelryme

    (@jewelryme)

    waw..thanks a lot.

    One more question please:
    Is it possible to remove the link option on description field. I just want to not allow users to add links there because of spam. Maybe to transform that description field in simple txt field?

    Thread Starter jewelryme

    (@jewelryme)

    pease ignore my last question. I just disabled the visual editor and it worked.

    One more question please: For example if I delete a user from the wordpress admin…what happen with the user listings? The listings will be deleted or disabled from your front end plugin?

    • This reply was modified 7 years, 2 months ago by jewelryme.

    I Use this code, and i have phone and location…
    https://tnij.at/178551

    Plugin Author Greg Winiarski

    (@gwin)

    1. When you delete a user from wp-admin / Users panel WP will ask you what to do with this user posts.

    2. Where do you have this code added?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove location and phone number’ is closed to new replies.