Skip to content

Activate plugins as if is_admin() #16

@JDGrimes

Description

@JDGrimes

I've just run across a plugin that will only be activated properly if the activation hook is called when is_admin() is true. The underlying code is actually risky and ill-conceived. However, that aside, it brought to my attention the fact that WordPress core always activates plugins when is_admin() is true. The question is, should we simulate that in our plugin activation code? After all, the plugin related functions are all currently stored in wp-admin/includes. However, I think it is good not to rely entirely on being in the admin either. It is probably better for the activation routine not to make those kinds of assumptions. But maybe it would be best for us to allow either way to be tested, as in admin and not as in admin.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions