Skip to content

Commit

Permalink
Modified is_options_page check, valu-digital#92
Browse files Browse the repository at this point in the history
  • Loading branch information
g-rasse committed Jun 24, 2024
1 parent ca67d22 commit 632dd5a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/OptionsPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,17 @@ static function add_translation_suffix($id)

static function is_options_page($source)
{

if( $source instanceof \WPGraphQL\Acf\Model\AcfOptionsPage ) {
return true;
}

if (!is_array($source)) {
return false;
}

$type = $source['type'] ?? null;
return $type === 'options_page';
$type = $source['node']->acfId ?? null;
return $type === 'options';
}

static function is_options_page_root_query(ResolveInfo $info)
Expand Down

0 comments on commit 632dd5a

Please sign in to comment.