Commit Graph

16 Commits

Author SHA1 Message Date
Sergey Biryukov
cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov
a8f4ed69de Docs: Update links to https://secure.php.net/, they now redirect to https://www.php.net/.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47088 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-20 03:12:12 +00:00
Sergey Biryukov
890bd870e8 Docs: Correct @param type for the function parameter in tests_add_filter() and _test_filter_build_unique_id().
Synchronize documentation for `add_filter()`, `tests_add_filter()`, `_wp_filter_build_unique_id()`, `_test_filter_build_unique_id()`.

Add a note that `$tag` and `$priority` are no longer used in `_wp_filter_build_unique_id()` since [46220], and the function always returns a string now.

Props donmhico, remcotolsma, SergeyBiryukov.
Fixes #47407. See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@46801 602fd350-edb4-49c9-b593-d223f7449a82
2019-11-29 21:40:58 +00:00
Sergey Biryukov
d4d853ee3f Code Modernisation: Replace call_user_func_array() in combination with an empty array in wp-includes/class-wp-hook.php with call_user_func().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46139 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:44:09 +00:00
Sergey Biryukov
4bd76c15b5 Docs: Fix typo in WP_Hook::resort_active_iterations() description.
Props itowhid06.
Fixes #47999.

git-svn-id: https://develop.svn.wordpress.org/trunk@46082 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-08 13:15:19 +00:00
Gary Pendergast
4503f93961 Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45590 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 23:41:16 +00:00
John Blackbourn
fe7958889a Docs: Improve and correct documentation for hook-related variadic functions.
See #37402


git-svn-id: https://develop.svn.wordpress.org/trunk@45420 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-25 22:51:14 +00:00
Sergey Biryukov
c6c4edb47a Docs: Remove @static notations from method DocBlocks in wp-includes/* classes.
This tag has been used in the past, but should no longer be used. Just using the `static` keyword in code is enough for PhpDocumentor on PHP5+ to recognize static variables and methods, and PhpDocumentor will mark them as static.

Props birgire.
See #42803.

git-svn-id: https://develop.svn.wordpress.org/trunk@42746 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 20:21:37 +00:00
Gary Pendergast
8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
Dion Hulse
21ad5a9e40 Remove the svn:executable property from files that don't need it.
See #42594


git-svn-id: https://develop.svn.wordpress.org/trunk@42200 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-17 02:57:27 +00:00
Sergey Biryukov
9ad6dab3db Docs: Use correct order of arguments in the DocBlock for WP_Hook::has_filter().
Props munyagu.
Fixes #41941.

git-svn-id: https://develop.svn.wordpress.org/trunk@41551 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 09:59:12 +00:00
Drew Jaynes
b4d81bd654 Docs: Remove @access notations from method DocBlocks in wp-includes/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.


git-svn-id: https://develop.svn.wordpress.org/trunk@41162 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 00:40:27 +00:00
Drew Jaynes
704731b9d3 Docs: Replace a variety of http links referenced in inline docs with their https counterparts (where possible).
Props johnpgreen.
Fixes #40732.


git-svn-id: https://develop.svn.wordpress.org/trunk@40948 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-25 22:05:54 +00:00
Gary Pendergast
5ff3f14d78 Plugins: Add a current_priority() method to WP_Hook.
This allows plugins to determine the currently running priority of a filter.

Fixes #39007.



git-svn-id: https://develop.svn.wordpress.org/trunk@39430 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 07:09:33 +00:00
Drew Jaynes
45c799d84a Docs: Fix minor formatting for inline docs in WP_Hook following its introduction in [38571].
See #17817.


git-svn-id: https://develop.svn.wordpress.org/trunk@38573 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 04:16:39 +00:00
Gary Pendergast
61abf68e6d Hooks: Add the new class WP_Hook, and modify hook handling to make use of it.
Filters and actions have been the basis of WordPress' plugin functionality since time immemorial, they've always been a reliable method for acting upon the current state of WordPress, and will continue to be so.

Over the years, however, edge cases have cropped up. Particularly when it comes to recursively executing hooks, or a hook adding and removing itself, the existing implementation struggled to keep up with more complex use cases.

And so, we introduce `WP_Hook`. By changing `$wp_filter` from an array of arrays, to an array of objects, we reduce the complexity of the hook handling code, as the processing code (see `::apply_filters()`) only needs to be aware of itself, rather than the state of all hooks. At the same time, we're able te handle more complex use cases, as the object can more easily keep track of its own state than an array ever could.

Props jbrinley for the original architecture and design of this patch.
Props SergeyBiryukov, cheeserolls, Denis-de-Bernardy, leewillis77, wonderboymusic, nacin, jorbin, DrewAPicture, ocean90, dougwollison, khag7, pento, noplanman and aaroncampbell for their testing, suggestions, contributions, patch maintenance, cajoling and patience as we got through this.
Fixes #17817.



git-svn-id: https://develop.svn.wordpress.org/trunk@38571 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 03:54:13 +00:00