wpgraphql-acf
wpgraphql-acf copied to clipboard
(format: RAW) not available for WYSIWYG
Hi,
First, thank you for the library.
However: I am seeing an issue with WYSIWYG field, where the format arg/enum available on standard content fields is missing.
Would definitely be a great feature to have.
Our case is that we want to parse some shortcodes from a thin (Jamstack) front-end, which I suppose is pretty standard; as opposed to working our way backward from the rendered shortcodes.
https://github.com/wp-graphql/wp-graphql/issues/160
(same here on gallery's description field)
@nonlinearcom
Here's a temporary solution:
add_filter('graphql_resolve_field', 'strip_tags_from_image_caption', 1000, 9);
function strip_tags_from_image_caption($result, $source, $args, $context, $info, $type_name, $field_key, $field, $field_resolver) {
if ($field_key === 'caption') {
return trim(strip_tags($result));
}
return $result;
}
This plugin is being re-built over here: https://github.com/wp-graphql/wpgraphql-acf
I think this enhancement is worth considering for the re-architected version of the plugin, so I'm going to transfer this issue to that repo and we'll work on it in the new version as this repo will be archived in the not-too-distant future.
@jasonbahl having taken note of the upcoming archival of the previous repo, I just wanted to let you know that although I am not working on this project at this time, I am sincerely grateful for the excellent work that is still going on with WPGraphQL.
We've found it very useful and I am looking forward to any new development.