Home Forums Front-end Issues Front end update issue


Front end update issue

  • I’ve added the front end form to my CPT template page so that the user can edit the info direct from the same page if they need to.
    The form displays fine and pulls all the correct information. The problem I’m getting is when I go to make an edit – it works correct in the front end form, it works correct inside the WP backend, but the relationship fields aren’t updating, they still show the original value, not the newer, edited value. Code is below.

    $job_to_contact = get_posts(array(
    	'post_type' => 'people',
    	'meta_query' => array(
    			'key' => 'job_site_contact', // name of custom field
    			'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
    			'compare' => 'LIKE'
    <?php if( $job_to_contact ): ?>
    	<?php foreach( $job_to_contact as $job_to_contact ):?>
    				<a href="<?php echo get_permalink( $job_to_contact->ID ); ?>">
    					<?php echo get_the_title( $job_to_contact->ID ); ?>
    				<p><?php the_field('email_address', $job_to_contact->ID); ?></p>
    				<p><?php the_field('job_responsibilities', $job_to_contact->ID); ?></p>
    				<p><?php the_field('mobile_number', $job_to_contact->ID); ?></p>
    				<p><?php the_field('direct_dial_number', $job_to_contact->ID); ?></p>
    	<?php endforeach; ?>
    <?php endif; ?>
Viewing 1 post (of 1 total)

The topic ‘Front end update issue’ is closed to new replies.