optional adverts_email
-
Hello,
I’m working to make
adverts_emailoptional; I’ve read through all the places in wpadverts proper as well as the addons we are using, and I find it’s used for payment and for registering user accounts, neither of which we are doing. We have your custom fields plugin, so I unchecked ‘Required’ for Email – no problem there.The one and I think only issue we have now is the contact form (‘Send Message’ button) is still visible even when there is no email address. It is trivial to hide that conditionally, and I’m asking if you would please incorporate this patch or something similar:
--- a/wp-content/plugins/wpadverts/addons/contact-form/contact-form.php +++ b/wp-content/plugins/wpadverts/addons/contact-form/contact-form.php @@ -48,6 +48,7 @@ function adext_contact_form( $post_id ) { $show_form = false; $flash = null; + $email = get_post_meta( $post_id, "adverts_email", true ); $phone = get_post_meta( $post_id, "adverts_phone", true ); $message = null; $form = new Adverts_Form( Adverts::instance()->get( "form_contact_form" ) ); @@ -114,10 +115,12 @@ function adext_contact_form( $post_id ) { <?php echo $flash ?> <div class="adverts-single-actions"> + <?php if( ! empty( $email ) ): ?> <a href="#" class="adverts-button adverts-show-contact-form"> <?php esc_html_e("Send Message", "adverts") ?> <span class="adverts-icon-down-open"></span> </a> + <?php endif; ?>If you don’t want to, could you tell me if there are any other options to accomplish this? (ie. hide the contact form if the
adverts_emailis empty) Right now the best I can see is to remove the call toadext_contact_form()from theadverts_tpl_single_bottomaction, then duplicate that function, make my changes, and hook my function instead. I’d rather not have to duplicate all that code for such a simple thing…Thanks!
The topic ‘optional adverts_email’ is closed to new replies.