• I’m creating custom templates, so have tried to echo the form on the page where I need it, rather than just appended at the end of the content.

    However, whilst I can get the form to display. It doesn’t send any data back to broadbean.

    Am I doing something wrong here?

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Mark Wilkinson

    (@wpmarkuk)

    Does the job which is being applied for have an application email in the WordPress backend?

    Thread Starter georgemccann7

    (@georgemccann7)

    It does. I can see the email field has been populated, so not sure what’s stopping the data sending back to broadbean…

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    The first thing to to check is whether your site is sending emails successfully as the plugin uses the wp_mail() function to send the application to Broadbean.

    If that is working then you need to debug the application processing.

    The processing of the application form is fired on the wp hook in WordPress. The function responsible (wpbb_process_application_form()) checks whether any application form data is posted using.

    
    // if the form has been posted.
    if ( ! isset( $_POST['wpbb_application_data'] ) ) {
    	return;
    }
    

    If that check passes along with the nonce check the processing occurs. This includes creating an application post (temporarily) and then sending notifications before the application is removed from WordPress.

    Therefore to debug this I would take a look at the wpbb_process_application_form () function inside:

    /inc/applications/application-processing.php

    The first thing to do would be to check that function is processing the application.

    Thread Starter georgemccann7

    (@georgemccann7)

    I think I have found the issue.

    Looking at appication-form.php, it has a <form> tag wrapper, as expected. However, when I inspect my HTML – this tag is missing around the form. Am I using the wrong function to display the form?

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    The application form, using the wpbb_job_application_form() function is rendered using this view file:

    https://github.com/highrisedigital/wpbroadbean/blob/934bfdadb5c4b82280c4870a67524eaf64811ebf/views/application-form.php

    However I am not seeing that markup in your example in your modal?

    Also noticed that if you are using wpbb_job_application_form() then this already echo’s so you shouldn’t have to.

    Thread Starter georgemccann7

    (@georgemccann7)

    Yeah, so my template is just using the following line:

    echo wpbb_job_application_form($_GET['post_id']);

    So I’m not sure why the markup isn’t displaying…

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    Can’t see this making a difference but you shouldn’t need the echo part. Try this:

    wpbb_job_application_form($_GET['post_id']);

    Thread Starter georgemccann7

    (@georgemccann7)

    Have removed the echo and still no form tag…

    Interestingly, though, it does appear to add the first part of that template wrapper, as it adds the div with the wpbb-application-form__wrapper class.

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    I assume it is Javascript that is handling the modal and therefore I wonder if that is interfering?

    Perhaps try adding the code to a single template file for a specific job post ID to check.

    Thread Starter georgemccann7

    (@georgemccann7)

    I’ve stripped out the template into a single page. Whilst the form now does post – it does nothing once posted:

    https://bramwith.candutu.com/job-form?testId=1060

    Current code for this page is

    global $post;  
    
    $post = get_post( $_GET['testId']);
    
    setup_postdata( $post );
    
    echo 'POST ID = '. $post->ID;  
     
    wpbb_job_application_form($post->ID);
    
    wp_reset_postdata();

    I’m forcing the post ID as I notice that the global post id is used to proccess

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    Does the form work when used as the plugin is intended appended to the content of the job post?

    Thread Starter georgemccann7

    (@georgemccann7)

    It does, but I need away to be able to quick apply for jobs on the job overview page. Therfore need the forms working here.

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    All I can suggest is to start debugging the processing code with some wp_die() functions and var_dump variables to see where the processing is failing.

    Thread Starter georgemccann7

    (@georgemccann7)

    inc/application-form.php, line 30 –

    The $wpbb_messages returns nothing.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘echo wpbb_job_application_form in custom template form doesn’t work’ is closed to new replies.