Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a block attribute filter #124

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jonsherrard
Copy link

@jonsherrard jonsherrard commented Sep 8, 2021

Adds a new filter called graphql_gutenberg_block_attribute_value.

Each attribute value is run through this filter.

Inspiration was taken from here: #81

This allows user to run modify attributes from their functions.php or theme.

The most common use case will probably be running attribute values through WP Offload S3. Which allows users of that plugin to use WP GraphQL Gutenberg for blocks with images or any other media.

<?php
// In functions.php or plugin.php
function my_theme_modify_graphql_gutenberg_block_attribute($value) { 
  $value = apply_filters('as3cf_filter_post_local_to_provider', $value);
   return $value; 
} 

add_filter('graphql_gutenberg_block_attribute_value', 'my_theme_modify_graphql_gutenberg_block_attributes');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant