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 styles not rendered in frontend when using ajax page refreshing after updating to version 3.2.0 #9673

Open
slr1979 opened this issue Sep 12, 2023 · 1 comment
Labels
type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.

Comments

@slr1979
Copy link

slr1979 commented Sep 12, 2023

Bug Report

Expected behavior

My site uses ajax page refreshing and prior to version 3.2.0 block styles rendered with no issue in a non-block based theme.

Actual behavior

When using ajax to navigate to pages with blocks in a non-block based theme, the layout is not applied as the function should_let_wp_manage_styles() in includes\blocks\includes\styles.php does not contain a way to override the default page checking action. It would be better to allow non-block based themes to override the should_let_wp_manage_styles() and any other associated functions to account for use cases where the styles should be rendered by default either on the first load or on template_redirect/init. An apply_filters or similar on the return of the function(s) would allow developers to decide other circumstances where block styles should load.

Information (if a specific version is affected):

PHP Version: 7.4

EDD Version (or branch): 3.2.0

WordPress Version: 6.3.1

Any other relevant information:
These recent changes to the way block styles render are preventing me from updating to the latest version as there is no hook to override the default behaviour and render the styles as they did prior to 3.2.0

@slr1979 slr1979 added type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on. labels Sep 12, 2023
@slr1979 slr1979 changed the title Block styles not rendered in frontend when using ajax page refreshing after version 3.2.0 Block styles not rendered in frontend when using ajax page refreshing after updating to version 3.2.0 Sep 12, 2023
@slr1979
Copy link
Author

slr1979 commented Sep 12, 2023

Following further investigation it appears that this issue can be resolved by removing the filter in the after_theme_setup() hook.

remove_filter('block_type_metadata', 'EDD\Blocks\Styles\filter_block_type_metadata' );

I am now able to see all inline styles for EDD blocks in the source so that my ajax-based theme has all styles available on the first load of the site

@cklosowski I would appreciate it if you could confirm that this is the appropriate method? It may be advisable to provide an easier way to bypass this perhaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.
Projects
None yet
Development

No branches or pull requests

1 participant