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

Fix/PRESS11-30 capabilities being checked on every pageload #628

Conversation

BrianHenryIE
Copy link
Contributor

@BrianHenryIE BrianHenryIE commented Oct 22, 2024

Proposed changes

Currently, capabilities requests are being made even for logged out users loading the homepage. This adds a current_user_can() check on $enable_onboarding so it doesn't run unnecessarily and make requests.

https://jira.newfold.com/browse/PRESS11-30

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

  • I first tried to do this in bootstrap.php but current_user_can()'s wp_get_current_user() function had not yet been loaded. Hence the changes to that file.

@officiallygod officiallygod merged commit a3d2cc9 into trunk Oct 23, 2024
8 checks passed
@officiallygod officiallygod deleted the Fix/PRESS11-30-capabilities-being-checked-on-every-pageload branch October 23, 2024 03:11
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