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

NEW block variation "Add to calendar" #954

Merged

Conversation

carstingaxion
Copy link
Collaborator

@carstingaxion carstingaxion commented Oct 18, 2024

Description of the Change

Bildschirmaufzeichnung.vom.18.10.2024.14.10.24.mp4

Closes #606

How to test the Change

  1. Open an event
  2. Add the new "Add to calendar (BUTTONS)" block.
  3. Add the new "Add to calendar (DETAILS)" block.
  4. Save
  5. View in frontend and check that Google & Yahoo buttons work.

Known Issue: ical & outlook have no href attribute.

I guess that WordPress added some escaping to the sources bound to the url attribute of a button.

Because, when I make a debug-change and direct the Block Binding API to output the values into the text attribute, instead of url, one can see that the URLs are properly delivered into the block.

metadata: {
	bindings: {
		text: {
			source: 'gatherpress/add-to-calendar',
			args: {
				service,
			},
		},
	},
},

I think the ical data-uri might just fail against esc_url() or something similar.

grafik

I would not recommend trying to fix this or to do any changes to this PR, but instead move #928 forward!

#928 and another, yet unfinished necessary follow-up (to fully align with #831) will introduce new named endoints like https://example.org/event/test-event-954/ical, which will make the escaping pass and the blocks work like expected.

Changelog Entry

Added - New block variation "Add to calendar"

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@carstingaxion carstingaxion marked this pull request as ready for review October 21, 2024 16:32
Copy link

Preview changes with Playground

You can preview the recent changes for PR#954 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@carstingaxion carstingaxion requested a review from mauteri October 21, 2024 16:33
@mauteri mauteri merged commit df180c7 into GatherPress:develop Oct 22, 2024
18 checks passed
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.

Convert add-to-calendar into interactive button block-variation
2 participants