18 lines
485 B
PHP
18 lines
485 B
PHP
<?php
|
|
|
|
// Default WPGraphQL settings
|
|
add_filter( 'graphql_get_setting_section_field_value', 'headless_wpgraphql_settings', 10, 5 );
|
|
function headless_wpgraphql_settings( $value, $default_value, $option_name, $section_fields, $section_name ) {
|
|
if ( $section_name === 'graphql_general_settings' ) {
|
|
switch ( $option_name ) {
|
|
case 'graphql_endpoint':
|
|
$value = 'graphql';
|
|
break;
|
|
case "public_introspection_enabled":
|
|
$value = "on";
|
|
break;
|
|
}
|
|
}
|
|
return $value;
|
|
}
|