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

Delay adding of runtime field groups #73

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

davejtoews
Copy link

Resolves issue #70

@sebastiaandegeus
Copy link
Contributor

Hi @davejtoews, I'm not completely sure about this. What if you run WordPress without a theme and only use the backend. Is this after_setup_theme still fired?

@davejtoews
Copy link
Author

@sebastiaandegeus I'm not entirely sure what you mean by "run WordPress without a theme". I'm not aware of a means of running WordPress without one theme or another activated.

However, if you mean setting the constant WP_USE_THEMES to false in index.php, thus disabling the front-end templates, then yes after_setup_theme is still run. In fact it appears that the active theme's functions.php is still executed, just not the template files.

Here's exactly what I did to verify this:

  1. Hook a function to after_setup_theme in the active theme's functions.php.
  2. Verify that this function is executed when loading admin views
  3. Verify that this function is executed when using the REST api
  4. Verify that this function is executed when loading front-end views
  5. Modify index.php in the WP root to include define('WP_USE_THEMES', false);
  6. Verify that this function is executed when loading admin views
  7. Verify that this function is executed when using the REST api
  8. Verify that this function is even executed when attempting to load front-end views (Front-end page does not load, but the function still executes.)

I can conclude in all cases that both the active theme's functions.php and the hook after_setup_theme are being executed. Unless you mean something else by running WP "without a theme", I do not believe this will be a problem.

@davejtoews
Copy link
Author

I should note that I added a second commit to my fork, based on PR #48 in order to address #74. If you wish to accept this PR but only to address #70, you'll want to cherry pick my first commit.

I personally need both fixes in order to continue using this plugin, and will be using my own fork until these issues are addressed.

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.

2 participants