Home » Blog » Wordpress » Advanced Custom Field (ACF) Tidak Muncul pada Post Preview

Advanced Custom Field (ACF) Tidak Muncul pada Post Preview

advanced custom field (ACF)

Sekedar catatan aja barang kali ada temen-temen yang bermasalah ketika menggunakan ACF plugin di WordPress. Jadi ketika klik “Preview” konten pada ACF ini kadang tidak tampil atau tidak berubah.

<?php
/*
Debug preview with custom fields
Taken from: http://support.advancedcustomfields.com/forums/topic/preview-solution/
See also: http://support.advancedcustomfields.com/forums/topic/2nd-every-other-post-preview-throws-notice/
*/
add_filter('_wp_post_revision_fields', 'add_field_debug_preview');
function add_field_debug_preview($fields){
$fields["debug_preview"] = "debug_preview";
return $fields;
}
add_action( 'edit_form_after_title', 'add_input_debug_preview' );
function add_input_debug_preview() {
echo '<input type="hidden" name="debug_preview" value="debug_preview">';
}
view raw functions.php hosted with ❤ by GitHub

Demikian post Advanced Custom Field (ACF) Tidak Muncul pada Post Preview ini, semoga bermanfaat. hehe… Jika ada pertanyaan silahkan tulis di kolom komentar ya

Leave a Reply

Your email address will not be published. Required fields are marked *