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

Toolbar: Make the 'Edit site' link aware of the current template #4810

Closed

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Jul 7, 2023

PR makes the 'Edit site' link in the toolbar contextually aware of the current template.

How

Introduces a new global $_wp_current_template_id that stores the current template ID during the template resolution.

We can't use the existing $_wp_current_template_content global as it only stores template contents.

Refs

Gutenberg issue: WordPress/gutenberg#37850
Trac ticket: https://core.trac.wordpress.org/ticket/58746

Copy link
Contributor

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. However, we also need two docblock updates :)

src/wp-includes/admin-bar.php Show resolved Hide resolved
src/wp-includes/block-template.php Show resolved Hide resolved
@Mamaduka
Copy link
Member Author

Mamaduka commented Jul 7, 2023

Thank you, @audrasjb! I added DocBlocks in 447fba8.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Mamaduka for the PR, $ missing in global.

src/wp-includes/admin-bar.php Outdated Show resolved Hide resolved
src/wp-includes/block-template.php Outdated Show resolved Hide resolved
Mamaduka and others added 2 commits July 7, 2023 16:28
Copy link
Contributor

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Mamaduka Mamaduka closed this Jul 11, 2023
@Mamaduka Mamaduka deleted the try/edit-site-active-template-link branch July 11, 2023 18:51
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.

3 participants