Support

Account

Home Forums General Issues Custom Fields on post Preview Reply To: Custom Fields on post Preview

  • my workaround is to call wordpress core function get_post_field instead of get_field that was not working in draft posts and then treat the response differently

    if('draft'==$post->post_status){
    		$image=get_post_field('image',$post->ID);
    		if($image){
    			$image=...;
    		}
    	}else{
    		$image=get_field('image',$post->ID);
                    if($image){
    			$image=...;
    		}
    	}