Skip to content

Allow config errors to be display to users #114

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open

Conversation

pkevan
Copy link
Contributor

@pkevan pkevan commented Apr 23, 2025

Shows errors when user is logged in, and has appropriate capabilities.

Fixes #85.

Testing instructions

  1. Add field to new install of SCF
  2. Use shortcode [acf] to output field via [acf field=""]
  3. Observe that with an administrator role, no output is display
  4. Apply this PR
  5. Re-test output, and a display error should be displayed in place of the field output
  6. Check while logged out that no output is display as was show when logged in as administrator

Note: considered adding this to (

if ( is_preview() ) {
), but given the additional filter, it didn't seem appropriate, although happy to be convinced otherwise.

Shows errors when user is logged in, and has appropriate capabilities.

Fixes #85.
@pkevan pkevan added the [Type] Enhancement New feature or request label Apr 23, 2025
@priethor
Copy link
Contributor

Hi Paul! Can you share brief instructions in the PR description to test the PR?

@pkevan
Copy link
Contributor Author

pkevan commented Apr 23, 2025

Hi Paul! Can you share brief instructions in the PR description to test the PR?

Most of the details are in the original issue: #85 (comment) but can adjust the PR if needed a bit later.

@priethor
Copy link
Contributor

I would suggest adding, in general, a short section with steps to test it and the expected outcome with and without the PR, similar to Gutenberg PRs. Even though the original ticket wasn't too hard to follow, it still required me to read all the comments to get the context 😅

@pkevan
Copy link
Contributor Author

pkevan commented Apr 24, 2025

I would suggest adding, in general, a short section with steps to test it and the expected outcome with and without the PR, similar to Gutenberg PRs. Even though the original ticket wasn't too hard to follow, it still required me to read all the comments to get the context 😅

Added in test instruction.

@priethor
Copy link
Contributor

For documentation purposes, note that I had to do some (obvious) extra steps:

  • Enable shortcodes programmatically.
  • The Field Group is assigned to posts

With this branch, the error message appears indeed. However, I also see it when using the shortcode to display a Text Field, which, in theory, is supported by the shortcode. Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shortcode Bug
2 participants