Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'graphql_register_types', function() {
- register_graphql_field( 'Product', 'tech_specs', [
- 'type' => 'String',
- 'description' => __( 'tech specs', 'wp-graphql' ),
- 'resolve' => function( $post ) {
- $id = $post->ID;
- $specs = get_field( "tech_specs",$id);
- $enc = strip_tags($specs,"<p>,<br>,<ul>,<li>");
- return $enc;
- }
- ] );
- } );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement