• Resolved contemplate

    (@contemplate)


    I found that when I used ACF Post Object field to select a single Post associated with another content type the PostID is not stored as an array in the postmeta table. This makes the Related Post Query Post is in Current Post Custom Field not work.

    I was able to fix this by adding one line to the code which I hope can be in the next release:
    file: /advanced-post-queries/advanced-post-queries/module.php
    line: 482

    Change this:

    if( $posts ){
    	$query_vars[ 'post__in' ] = $posts;
    }else{
    	$query_vars[ 'post__in' ] = array( 0 );
    }
    

    to this:

    if( $posts ){
    	$posts = (is_array($posts)) ? $posts : [$posts];
    	$query_vars[ 'post__in' ] = $posts;
    }else{
    	$query_vars[ 'post__in' ] = array( 0 );
    }
    
    • This topic was modified 2 years, 10 months ago by contemplate.
    • This topic was modified 2 years, 10 months ago by contemplate.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Fixed] Post is in Current Post Custom Field’ is closed to new replies.