Support

Account

Home Forums General Issues Insert custom fields inside a WP job manager submit listing Reply To: Insert custom fields inside a WP job manager submit listing

  • Hi, thanks for getting back!

    The template in question is called job-submit.php

    
    <?php
    /**
     * Job Submission Form
     */
    if ( ! defined( 'ABSPATH' ) ) exit;
    
    global $job_manager;
    ?>
    <form action="<?php echo esc_url( $action ); ?>" method="post" id="submit-job-form" class="job-manager-form" enctype="multipart/form-data">
    
    	<?php do_action( 'submit_job_form_start' ); ?>
    
    	<?php if ( apply_filters( 'submit_job_form_show_signin', true ) ) : ?>
    
    		<?php get_job_manager_template( 'account-signin.php' ); ?>
    
    	<?php endif; ?>
    
    	<?php if ( job_manager_user_can_post_job() || job_manager_user_can_edit_job( $job_id ) ) : ?>
    
    		<!-- Job Information Fields -->
    		<?php do_action( 'submit_job_form_job_fields_start' ); ?>
    
    		<?php foreach ( $job_fields as $key => $field ) : ?>
    			<fieldset class="fieldset-<?php esc_attr_e( $key ); ?>">
    				<label for="<?php esc_attr_e( $key ); ?>"><?php echo $field['label'] . apply_filters( 'submit_job_form_required_label', $field['required'] ? '' : ' <small>' . __( '(optional)', 'wp-job-manager' ) . '</small>', $field ); ?></label>
    				<div class="field <?php echo $field['required'] ? 'required-field' : ''; ?>">
    					<?php get_job_manager_template( 'form-fields/' . $field['type'] . '-field.php', array( 'key' => $key, 'field' => $field ) ); ?>
    				</div>
    			</fieldset>
    		<?php endforeach; ?>
    
    		<?php do_action( 'submit_job_form_job_fields_end' ); ?>
    
    		<!-- Company Information Fields -->
    		<?php if ( $company_fields ) : ?>
    			<h2><?php _e( 'Company Details', 'wp-job-manager' ); ?></h2>
    
    			<?php do_action( 'submit_job_form_company_fields_start' ); ?>
    
    			<?php foreach ( $company_fields as $key => $field ) : ?>
    				<fieldset class="fieldset-<?php esc_attr_e( $key ); ?>">
    					<label for="<?php esc_attr_e( $key ); ?>"><?php echo $field['label'] . apply_filters( 'submit_job_form_required_label', $field['required'] ? '' : ' <small>' . __( '(optional)', 'wp-job-manager' ) . '</small>', $field ); ?></label>
    					<div class="field <?php echo $field['required'] ? 'required-field' : ''; ?>">
    						<?php get_job_manager_template( 'form-fields/' . $field['type'] . '-field.php', array( 'key' => $key, 'field' => $field ) ); ?>
    					</div>
    				</fieldset>
    			<?php endforeach; ?>
    
    			<?php do_action( 'submit_job_form_company_fields_end' ); ?>
    		<?php endif; ?>
    
    		<?php do_action( 'submit_job_form_end' ); ?>
    
    		<p>
    			<input type="hidden" name="job_manager_form" value="<?php echo $form; ?>" />
    			<input type="hidden" name="job_id" value="<?php echo esc_attr( $job_id ); ?>" />
    			<input type="hidden" name="step" value="<?php echo esc_attr( $step ); ?>" />
    			<input type="submit" name="submit_job" class="button" value="<?php esc_attr_e( $submit_button_text ); ?>" />
    		</p>
    
    	<?php else : ?>
    
    		<?php do_action( 'submit_job_form_disabled' ); ?>
    
    	<?php endif; ?>
    </form>
    

    In my functions.php on my child theme, I have

    
    add_filter( 'submit_job_form_fields', 'frontend_add_custom_fields' );
    
    function frontend_add_custom_fields( $custom_fields ) {
    
    $custom_fields = acf_form(array(
    'field_groups' => array(856),
    'form' => false	));
    
    return $custom_fields;
    }
    

    where 856 seems to be the Group ID.

    I can now see the fields at the top of the page but there are some errors and some fields wp job manager fields are missing:

    
    Warning: include(SITEROOT/wp-content/themes/listify/inc/integrations/wp-job-manager/templates/form-fields/-field.php): failed to open stream: No such file or directory in SITEROOT\wp-content\plugins\wp-job-manager\wp-job-manager-template.php on line 26
    
    
    Warning: include(): Failed opening 'SITEROOT/wp-content/themes/listify/inc/integrations/wp-job-manager/templates/form-fields/-field.php' for inclusion (include_path='.;DRIVEROOT\xampp\php\PEAR') in SITEROOT\wp-content\plugins\wp-job-manager\wp-job-manager-template.php on line 26
    

    Also the fields are not saved when hitting Preview

    In the edit job listing page I can also see the ACF custom fields but some wp job listing fields still missing and the ACF custom fields are not saved when I click Update.