Skip to content

Commit

Permalink
Merge pull request #1 from tavux-ratkaisut/fix/options-missing-type
Browse files Browse the repository at this point in the history
Modified is_options_page check, valu-digital#92
  • Loading branch information
tavux-ratkaisut authored Jun 24, 2024
2 parents ca67d22 + 632dd5a commit 90e6c07
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 90e6c07

Please sign in to comment.