Created
December 22, 2018 19:55
-
-
Save jkhaui/7c654df6d09901d9c5018365b8e0fcf1 to your computer and use it in GitHub Desktop.
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
$fields['seriesPart'] = [ | |
'type' => \WPGraphQL\Types::int(), | |
'description' => __( 'The number of the post within its series.' ), | |
'resolve' => function( \WP_Post $post ) { | |
$series_number = get_post_meta( $post->ID, '_series_part', true ); | |
return ! empty ( $series_number ) ? $series_mumber : null; | |
}, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment