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

Block Editor Handbook: Improve it on Github links are broken #513

Closed
ryanwelcher opened this issue May 6, 2024 · 4 comments · Fixed by #517
Closed

Block Editor Handbook: Improve it on Github links are broken #513

ryanwelcher opened this issue May 6, 2024 · 4 comments · Fixed by #517
Assignees
Labels
[Type] Bug Something isn't working

Comments

@ryanwelcher
Copy link

ryanwelcher commented May 6, 2024

All links I've spot checked in the Block Editor handbook have broken links.

The hrefs are appended with [article_edit_link].

For example: https://developer.wordpress.org/block-editor/

The link goes to : https://developer.wordpress.org/block-editor/[article_edit_link]

Block_Editor_Handbook___Developer_WordPress_org

Note: requires Gutenberg 18.1+ to reproduce

@dd32
Copy link
Member

dd32 commented May 7, 2024

Transferring issue to correct repo

I'm unable to duplicate.

All the links are correct for me, and curl https://developer.wordpress.org/block-editor/ | grep 'article_edit_link' shows nothing.

Note, that that is the shortcode being used though, which suggests shortcodes weren't applying (Which you cal also see from the [last_updated] shortcode being present in the image)

https://github.com/WordPress/wporg-developer/blob/trunk/source/wp-content/themes/wporg-developer-2023/patterns/article-meta.php#L17

https://github.com/WordPress/wporg-developer/blob/trunk/source/wp-content/themes/wporg-developer-2023/inc/shortcodes.php#L28-L41

@dd32 dd32 transferred this issue from WordPress/wordpress.org May 7, 2024
@adamwoodnz
Copy link
Contributor

adamwoodnz commented May 7, 2024

Sorry, slow to update the ticket. This happened earlier today when we unpinned Gutenberg and switched to trunk. With trunk the hook we are using to process shortcodes in patterns stopped firing (see WordPress/gutenberg#60349), so we have rolled back. We still need a long term solution.

@ryanwelcher
Copy link
Author

Looks like this is resolved and this issue is in the wrong place so I'll close this ticket.

@ryelle
Copy link
Contributor

ryelle commented May 7, 2024

It looks like shortcodes do work as normal block content, but not in attributes. Depending on the outcome of WordPress/wporg-parent-2021#136, we might want to reopen this to switch out for shortcodes in core blocks, or maybe block bindings.

For example, these shortcodes work, but you can see the last_updated heading isn't rendered.

<!-- wp:paragraph -->
<p>[article_edit_link]</p>
<!-- /wp:paragraph -->

<!-- wp:button {"className":"is-small"} -->
<div class="wp-block-button is-small"><a href="[article_edit_link]" class="wp-block-button__link wp-element-button"><?php esc_html_e( 'Edit', 'wporg' ); ?></a></div>
<!-- /wp:button -->
Screenshot 2024-05-07 at 1 06 37 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants