Support

Account

Home Forums ACF PRO Frontend Post Excerpt Field With acf_form() Reply To: Frontend Post Excerpt Field With acf_form()

  • Well, I guess I figured it out. However, would doing this even be advisable?

    I ask because… if we’re be able to manage the post_excerpt via acf/save_post with a custom ACF WYSIWG field, wouldn’t it just bloat the database? I.e. have a value stored for both the ACF and post_excerpt field?

    The code I’ve used:

    function update_post_excerpt($post_id) {
    
    	// Set excerpt value from field
    	$post_excerpt = get_field('field_12345',$post_id);
    	
    	// Update post options array
    	$update_post_excerpt_args = array(
    		'ID'			=> $post_id,
    		'post_excerpt'	=> $post_excerpt,
    	);
    	
    	// Update the post into the database
    	wp_update_post( $update_post_excerpt_args );
    }
    
    add_action('acf/save_post', 'update_post_excerpt', 20);