Go to file
Andrew Nacin 68c8b9cf0f Introduce doing_filter() and doing_action() to identify hooks in progress.
did_action() returns true the moment a hook is initially run, leaving you no way to tell if the hook is still in progress. Hooks can be nested and this checks the entire stack, versus current_filter() which only identifies the final hook in the stack. This commit also introduces current_action() for parity.

To tell if a hook has completed, one can use did_action() and ! doing_action() together.

The functions do not require an argument. In that situation, they indicate whether the stack is empty.

props ericmann for the initial unit tests.
fixes #14994.


git-svn-id: https://develop.svn.wordpress.org/trunk@27294 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 18:43:59 +00:00
src Introduce doing_filter() and doing_action() to identify hooks in progress. 2014-02-26 18:43:59 +00:00
tests Introduce doing_filter() and doing_action() to identify hooks in progress. 2014-02-26 18:43:59 +00:00
tools/i18n Extract: rename method extract_entries to extract_from_code 2013-10-26 00:54:27 +00:00
.editorconfig Add .editorconfig file, see http://editorconfig.org/. 2014-02-20 02:35:38 +00:00
.gitignore Add more .gitignore entries for unit test files. 2013-12-03 18:48:58 +00:00
.jshintrc Remove smarttabs from .jshintrc per IRC discussion. see #25187. 2013-11-13 19:23:16 +00:00
.travis.yml Add jshint to Travis CI config. 2014-02-25 17:57:04 +00:00
Gruntfile.js Add jshint to Travis CI config. 2014-02-25 17:57:04 +00:00
package.json Build: Update version of grunt-autoprefixer devDependency. 2014-02-23 10:29:42 +00:00
phpunit.xml.dist Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
wp-config-sample.php Move wp-config-sample.php to the root of develop.svn. 2013-08-29 20:45:17 +00:00
wp-tests-config-sample.php Update wp-tests-config-sample.php to run with WP_DEBUG by default. see #25282. 2013-09-23 16:17:59 +00:00