Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. add_action( 'graphql_register_types', function() {
  3. register_graphql_field( 'Product', 'tech_specs', [
  4. 'type' => 'String',
  5. 'description' => __( 'tech specs', 'wp-graphql' ),
  6. 'resolve' => function( $post ) {
  7. $id = $post->ID;
  8. $specs = get_field( "tech_specs",$id);
  9.  
  10. $enc = strip_tags($specs,"<p>,<br>,<ul>,<li>");
  11. return $enc;
  12. }
  13. ] );
  14. } );
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement