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

Classic themes: update the die handler to remove access to the Site Editor #68959

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

carolinan
Copy link
Contributor

@carolinan carolinan commented Jan 30, 2025

What?

Closes #68950

Updates function gutenberg_styles_wp_die_handler in the 6.8 Site Editor compatibility file to only allow access to patterns,
and conditional access to the first page and the stylebook.

In this PR, I am using the existing condition for accessing the style book: the editor-styles theme support, or theme.json.
It does not include the changes proposed to the theme support. #68940

Why?

Users of classic themes had access to parts of the Site Editor that do not work with classic themes.

Help wanted

Should the pattern page available to all users? Or should I re-add current_user_can( 'edit_theme_options' )
#61637

Testing Instructions

Activate a classic theme.
Go to wp-admin/site-editor.php?p=%2Ftemplate
Go to wp-admin/site-editor.php?p=%2Fpage
The screens should not be available and show a message saying that the theme is not compatible.

If the classic theme has added theme support for editor-styles:
Go to wp-admin/site-editor.php
Go to wp-admin/site-editor.php?p=stylebook
The screens should be available.

@carolinan carolinan added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Jan 30, 2025
@carolinan carolinan marked this pull request as ready for review January 30, 2025 07:56
Copy link

github-actions bot commented Jan 30, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: carolinan <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: Rishit30G <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@carolinan carolinan added the Needs Decision Needs a decision to be actionable or relevant label Jan 30, 2025
@Mamaduka
Copy link
Member

@youknowriad, @peterwilsoncc, similar condition should also be included in WordPress/wordpress-develop#7903.

@youknowriad
Copy link
Contributor

I think we should remove this condition entirely personally. All themes should have access to the site editor and the site editor should adapt to render what's available to them.

This condition also makes it very hard to iterate on the site editor.

@carolinan
Copy link
Contributor Author

carolinan commented Jan 31, 2025

I agree that it should, but the Site Editor pages does not do that right now.

@carolinan
Copy link
Contributor Author

I don't think we are understanding each other. Do you mean like this?

Screenshot of the template screen in the Site Editor, with a message saying the theme is not compatible.

@youknowriad
Copy link
Contributor

I don't think we are understanding each other. Do you mean like this?

I think it's better to render a message like that maybe with an empty sidebar.

Long term indeed, I don't see why this wouldn't show patterns, styles, template parts and custom block templates but that's a separate and larger effort indeed.

(Also, just sharing a passing by opinion, feel free to continue with what you think is best)

@carolinan
Copy link
Contributor Author

carolinan commented Jan 31, 2025

How about, trying to manage the permission in the Site Editor (navigation)pages directly and if that is not completed in time for 6.8, it can be done with the die handler if it absolutely has to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Decision Needs a decision to be actionable or relevant Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users of classic themes can access and use parts of the Site Editor but its a broken experience
3 participants