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

Automatically creating AppOption post doesn't work #2

Open
a-dg opened this issue Dec 2, 2016 · 0 comments
Open

Automatically creating AppOption post doesn't work #2

a-dg opened this issue Dec 2, 2016 · 0 comments
Assignees
Labels

Comments

@a-dg
Copy link
Contributor

a-dg commented Dec 2, 2016

At the bottom of AppOption.php, we have this:

// Make sure a record exists
add_action('plugins_loaded', 'AppOption::createDefaultInstanceIfNecessary');

This is never fired, because the earliest hook available to themes is after_setup_theme. However, I question its usefulness. If we changed the hook to after_setup_theme, this method would be called on the front-end as well as in the admin, and it in turn calls getCount(). That seems a little wasteful in exchange for the convenience of automatically handling a critical piece of functionality being missing.

I would be in favor of removing this action and its method. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants