Hi,
it is possible to remove the email field, but make sure to test your website if everything is working properly, as technically the email and title are two fields that should be never removed.
One case when it will definitely not work is when you allow users to check a “create account” checkbox in [adverts_add]. If the user will check it but will not provide an email address then this will cause an error. This is not a problem of course if you allow only logged in users to post ads.
Either way, in order to remove the email field from the [adverts_add] form you can add the code below in your theme functions.php
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_email" ) {
unset( $form["field"][$key] );
}
}
return $form;
}
Thanks, that’s it, it works!
About the disadvantage… I don’t allow guests to place adverts anyway.
Ohh ok, in this case, it should work fine, but i would still recommend testing it everything runs smoothly.