WebDevStudios / wds-headless-wordpress

This codebase has been moved to a monorepo. Please see the documentation to learn more. 🍻
https://github.com/WebDevStudios/nextjs-wordpress-starter
GNU General Public License v2.0
32 stars 15 forks source link

Add "URL External" attribute to Button block #24

Closed ravewebdev closed 2 years ago

ravewebdev commented 3 years ago

Related to #23, we need to add an attribute to indicate that a button URL is external or not. This would be passed to the FE where it could be used to set the urlExternal prop for the Button component.

Potential approach:

add_filter( 'acf/pre_save_block', 'wds_set_button_url_external' );

Where wds_set_button_url_external() checks if the button URL domain matches the FE domain and set urlExternal accordingly. #23 will need to be addressed first so cross-linking uses the FE instead of the WP domain.