forked from wp-graphql/wp-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into features/wp-grap…
…hql#156-optionsQueries
- Loading branch information
Showing
36 changed files
with
1,258 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
namespace WPGraphQL\Type\Enum; | ||
|
||
use WPGraphQL\Type\WPEnumType; | ||
|
||
/** | ||
* Class PostObjectFieldFormatEnumType | ||
* | ||
* This defines an EnumType with allowed formats of post field data. | ||
* | ||
* @package WPGraphQL\Type\Enum | ||
* @since 0.0.18 | ||
*/ | ||
class PostObjectFieldFormatEnumType extends WPEnumType { | ||
|
||
/** | ||
* This holds the enum values array. | ||
* | ||
* @var array $values | ||
*/ | ||
private static $values; | ||
|
||
public function __construct() { | ||
$config = [ | ||
'name' => 'postObjectFieldFormat', | ||
'description' => __( 'The format of post field data.', 'wp-graphql' ), | ||
'values' => self::values(), | ||
]; | ||
parent::__construct( $config ); | ||
} | ||
|
||
/** | ||
* Creates a list of formats of post field data. | ||
* | ||
* @return array | ||
*/ | ||
private static function values() { | ||
|
||
if ( null === self::$values ) { | ||
|
||
/** | ||
* Post object field formats. | ||
* | ||
* @since 0.0.18 | ||
*/ | ||
self::$values = [ | ||
'raw' => [ | ||
'name' => 'RAW', | ||
'description' => __( 'Provide the field value directly from database', 'wp-graphql' ), | ||
'value' => 'raw', | ||
], | ||
'rendered' => [ | ||
'name' => 'RENDERED', | ||
'description' => __( 'Apply the default WordPress rendering', 'wp-graphql' ), | ||
'value' => 'rendered', | ||
], | ||
]; | ||
|
||
} | ||
|
||
/** | ||
* Return the $values | ||
*/ | ||
return self::$values; | ||
} | ||
} |
Oops, something went wrong.