Same ACF Relationship field for multiple Post Options sub-pages?

The method to use is… In the acf_add_options_sub_page declaration, add ‘post_id’ => ‘article’ as a parameter. (post_id) This is how the field data, as entered on the Options page corresponding to my post type, will be saved. On the display end, display using $featured_posts = get_field(‘featured_posts’, ‘article’); ‘article’ and ‘report’ are both used. In my … Read more

Generate the post title from ACF fields

The $post_id value get in save_post hook might be revision ID. So to retrieve real post ID, you can use this function wp_is_post_revision() Try to change your code as follows, function set_post_title_from_acf($post_id) { // If this is a revision, get real post ID if ( $parent_id = wp_is_post_revision( $post_id ) ) $post_id = $parent_id; $my_post … Read more