Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Added condition to relationships #286

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ protected function register_graphql_field( string $type_name, string $field_name
if ( ! empty( $value ) && is_array( $value ) ) {
foreach ( $value as $post_id ) {
$post_object = get_post( $post_id );
if ( $post_object instanceof \WP_Post ) {
if ( $post_object->post_status == 'publish' && $post_object instanceof \WP_Post ) {
$post_model = new Post( $post_object );
$relationship[] = $post_model;
}
Expand Down