I have created a custom post type 'Candidates' which will be used to store the info submitted by a candidate who is applying for a vacancy. I also have a custom post type called Vacancies.
I have used ACF for the custom fields on both sets of post types.
I have setup an ACF front-end form to allow candidates to submit applications. I have a button that user clicks on the vacancy that sends them to a page where the form is. As part of the button I am passing the title of the vacancy and am able to pass and echo it on the page where the form is (so it is passing through).
for the life of me I cant get this vacancy title field to auto-populate the field on the front-end form.
Here are the code snippets. Page where I am creating the front-end form
$vacancy = isset( $_GET['vacancy'] ) ? esc_attr( $_GET['vacancy'] ) : '';
$vacancyurl = isset( $_GET['vacancyurl'] ) ? esc_attr( $_GET['vacancyurl'] ) : '';
acf_form_head();
get_header();
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<div class="candidateformcontainer">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<div>
<h1><?php echo get_the_title(); ?></h1>
<p>To proceed with submitting your application for <strong><?php echo $vacancy; ?></strong> complete the application form below.</p>
</div>
<?php
acf_form('acf-candidate-application-form');
?>
<?php endwhile; ?>
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer();
The field I am trying to pass the title to (so the $vacancy variable)
<?php the_field( 'vacancy_applied_for' ); ?>
Field Number: field_5dba152669aaf
Any help or pointers would be much appreciated. I have exhausted the ACF documentation.