Skip to content

Commit b8ed703

Browse files
committed
no message
1 parent 220fca6 commit b8ed703

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Admin/OptionsPageRegistration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public function add_registration_fields( array $args, array $post ) : array {
3838
$show_in_graphql = false;
3939

4040
if ( isset( $args['show_in_graphql'] ) ) {
41-
$show_in_graphql = $args['show_in_graphql'];
41+
$show_in_graphql = (bool) $args['show_in_graphql'];
4242
} elseif ( isset( $post['show_in_graphql'] ) ) {
43-
$show_in_graphql = $post['show_in_graphql'];
43+
$show_in_graphql = (bool) $post['show_in_graphql'];
4444
}
4545

4646
$args['show_in_graphql'] = $show_in_graphql;

src/Admin/Settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function display_graphql_field_group_fields( $field_group ): void {
238238
'type' => 'text',
239239
'prefix' => 'acf_field_group',
240240
'name' => 'graphql_field_name',
241-
'required' => isset( $field_group['show_in_graphql'] ) && $field_group['show_in_graphql'],
241+
'required' => isset( $field_group['show_in_graphql'] ) && (bool) $field_group['show_in_graphql'],
242242
'placeholder' => __( 'FieldGroupTypeName', 'wpgraphql-acf' ),
243243
'value' => ! empty( $field_group['graphql_field_name'] ) ? $field_group['graphql_field_name'] : '',
244244
],

src/LocationRules/LocationRules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ public function determine_block_rules( string $field_group_name, string $param,
890890
}
891891

892892
$acf_block = acf_get_block_type( $value );
893-
if ( ! isset( $acf_block['show_in_graphql'] ) || false === $acf_block['show_in_graphql'] ) {
893+
if ( ! isset( $acf_block['show_in_graphql'] ) || false === (bool) $acf_block['show_in_graphql'] ) {
894894
return;
895895
}
896896
$type_name = isset( $acf_block['graphql_field_name'] ) ? Utils::format_type_name( $acf_block['graphql_field_name'] ) : Utils::format_type_name( $acf_block['name'] );
@@ -945,7 +945,7 @@ public function determine_options_rules( string $field_group_name, string $param
945945

946946
// Get the options page to unset
947947
$options_page = acf_get_options_page( $value );
948-
if ( ! isset( $options_page['show_in_graphql'] ) || false === $options_page['show_in_graphql'] ) {
948+
if ( ! isset( $options_page['show_in_graphql'] ) || false === (bool) $options_page['show_in_graphql'] ) {
949949
return;
950950
}
951951
if ( ! empty( $options_page['graphql_single_name'] ) ) {

src/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public static function should_field_group_show_in_graphql( array $acf_field_grou
287287
$acf_field_group['show_in_graphql'] = $show_in_rest ?? false;
288288
}
289289

290-
if ( isset( $acf_field_group['show_in_graphql'] ) && false === $acf_field_group['show_in_graphql'] ) {
290+
if ( isset( $acf_field_group['show_in_graphql'] ) && false === (bool) $acf_field_group['show_in_graphql'] ) {
291291
$should = false;
292292
}
293293

0 commit comments

Comments
 (0)