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

Allow for definition of AJAX action slugs and adding actions in AjaxHandler\AbstractBase #63

Open
sdunham opened this issue Sep 28, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@sdunham
Copy link
Contributor

sdunham commented Sep 28, 2018

Right now, in order to actually add actions to use any custom AjaxHandler classes, you have to call add_action one or more times in Site::configure() (or functions.php if you're lame 👎) with whatever action slug(s) you've chosen to handle. I think it would make more sense to at least allow for the option of registering the action slugs you want to handle in your AjaxHandler class and provide a function to call in the config callback which will make the appropriate add_action calls based on those slugs.

Expected behavior

To register an action to be handled by a class, something like:
MyAjaxHandler::register_action($slug, $includePriv = true, $includeNoPriv = false)

To add_action(s) in the config callback based on previously-registered action slugs, something like:
MyAjaxHandler::add_actions()

Actual behavior

Right now, action slugs don't exist in AjaxHandler classes unless you're handling multiple actions with a single class, and even then you have to make individual calls to add_action for each of those slugs.

Steps to reproduce behavior

See Conifer\AjaxHandler\AbstractBase

What version of WordPress/PHP/Timber/Conifer are you using?

Conifer v0.3.0

How did you install Conifer? (for example, via git clone, GitHub zip download, Composer/Packagist?)

Cloned from GitHub

@acobster acobster added the enhancement New feature or request label May 12, 2019
@acobster
Copy link
Contributor

@sdunham did #66 address this fully? If not, can you update the description with Acceptance Crtieria?

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

No branches or pull requests

2 participants