Added dependency plugins
This commit is contained in:
38
wordpress/wp-content/plugins/wp-graphql/access-functions.php
Executable file
38
wordpress/wp-content/plugins/wp-graphql/access-functions.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* This file contains access functions for various class methods
|
||||
*
|
||||
* @since 0.0.2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Formats the name of a field so that it plays nice with GraphiQL
|
||||
*
|
||||
* @param string $field_name Name of the field
|
||||
*
|
||||
* @access public
|
||||
* @return string Name of the field
|
||||
* @since 0.0.2
|
||||
*/
|
||||
function graphql_format_field_name( $field_name ) {
|
||||
$field_name = preg_replace( '/[^A-Za-z0-9]/i', ' ', $field_name );
|
||||
$field_name = preg_replace( '/[^A-Za-z0-9]/i', '', ucwords( $field_name ) );
|
||||
$field_name = lcfirst( $field_name );
|
||||
|
||||
return $field_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a simple way to run a GraphQL query with out posting a request to the endpoint.
|
||||
*
|
||||
* @param string $request The GraphQL query to run
|
||||
* @param string $operation_name The name of the operation
|
||||
* @param string $variables Variables to be passed to your GraphQL request
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
* @since 0.0.2
|
||||
*/
|
||||
function do_graphql_request( $request, $operation_name = '', $variables = '' ) {
|
||||
return \WPGraphQL::do_graphql_request( $request, $operation_name, $variables );
|
||||
}
|
||||
Reference in New Issue
Block a user