• Resolved pasorobleswineries

    (@pasorobleswineries)


    Hi Greg,

    I modified my theme’s functions.php with the following code and only the price and location fields were removed. I need to remove the account and category fields. Please advise. Thanks!

    /**
    * Remove fields from WP-Adverts form.
    */

    add_filter( “adverts_form_load”, “my_adverts_form_remove_fields” );
    function my_adverts_form_remove_fields( $form ) {
    if($form[“name”] != “advert”) {
    return $form;
    }

    $to_remove = array(“adverts_account”, “adverts_price”, “adverts_category”, “adverts_location”);

    foreach($form[“field”] as $k => $field) {
    if(in_array($field[“name”], $to_remove)) {
    unset($form[“field”][$k]);
    }
    }

    return $form;
    }

    https://wordpress.org/plugins/wpadverts/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Deleting fields from the user form’ is closed to new replies.