Skip to content

WP_CLI::add_action() and WP_CLI::do_action() are confusing#845

Merged
scribu merged 1 commit into
masterfrom
hooks
Nov 29, 2013
Merged

WP_CLI::add_action() and WP_CLI::do_action() are confusing#845
scribu merged 1 commit into
masterfrom
hooks

Conversation

@scribu
Copy link
Copy Markdown
Member

@scribu scribu commented Nov 26, 2013

Exhibit A: #844 (comment)

They have the same names as the WordPress API (add_action() and do_action()), yet they don't inter-operate and don't even accept all of the same parameters.

One solution would be to give them different names, like WP_CLI::add_hook().

Another solution would be to copy all the code from their WP counterparts. This would mean that both WP-CLI events and WP events would reside in the same namespace. Need to study the implications of this further.

scribu pushed a commit that referenced this pull request Nov 29, 2013
WP_CLI::add_action() and WP_CLI::do_action() are confusing
@scribu scribu merged commit 037a3f0 into master Nov 29, 2013
@scribu scribu deleted the hooks branch November 29, 2013 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant