You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Right now, in order to actually add actions to use any custom AjaxHandler classes, you have to call
add_action
one or more times inSite::configure()
(orfunctions.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
The text was updated successfully, but these errors were encountered: