Commit Graph

126 Commits

Author SHA1 Message Date
Aaron Jorbin
95cbf8922b Bootstrap/Load: Load plugin.php earlier in wp-settings.php
In order to allow non-web initializations of WordPress (such as through wp-cli) to modify things like the check for maintenance mode, plugins.php and the associated functions must be available much earlier. The use of these functions earlier than the loading of plugins is not recommended in most use cases.

Fixes #36819. See #34936.
Props jorbin, danielbachhuber for documentation.

Built from https://develop.svn.wordpress.org/trunk@37588


git-svn-id: http://core.svn.wordpress.org/trunk@37556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-27 19:20:29 +00:00
Drew Jaynes
fe3b007fdd Docs: Remove inline @see tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@37342


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Dominik Schilling
4b51bc18cc Plugins: In plugin_basename() normalize the file path before unresolving symlinks.
`$wp_plugin_paths` contains normalized paths, see `wp_register_plugin_realpath()`.

Props jdgrimes, voldemortensen, flyingdr, ocean90.
Fixes #29154.
Built from https://develop.svn.wordpress.org/trunk@37332


git-svn-id: http://core.svn.wordpress.org/trunk@37298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-30 15:09:27 +00:00
Dominik Schilling
f3c20d5011 Docs: Fix indentation in add_filter() example.
See #32246.
Built from https://develop.svn.wordpress.org/trunk@36392


git-svn-id: http://core.svn.wordpress.org/trunk@36359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-25 18:58:27 +00:00
John Blackbourn
7e43e20436 Docs: @see != @since.
See #32246

Built from https://develop.svn.wordpress.org/trunk@36073


git-svn-id: http://core.svn.wordpress.org/trunk@36038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 07:13:26 +00:00
John Blackbourn
c2248060fe Add missing variadic markers to the optional parameters of do_action() and apply_filters().
See #32246

Built from https://develop.svn.wordpress.org/trunk@35912


git-svn-id: http://core.svn.wordpress.org/trunk@35876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 02:36:25 +00:00
John Blackbourn
2984cdf457 Revert [35910].
Built from https://develop.svn.wordpress.org/trunk@35911


git-svn-id: http://core.svn.wordpress.org/trunk@35875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 02:35:26 +00:00
John Blackbourn
de7ccd262a Built from https://develop.svn.wordpress.org/trunk@35910
git-svn-id: http://core.svn.wordpress.org/trunk@35874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 02:33:25 +00:00
John Blackbourn
aa35e473f7 callback is not a valid type in PHP, PSR-5, or phpDocumentor. callable should be used instead.
Fixes #34032

Built from https://develop.svn.wordpress.org/trunk@34566


git-svn-id: http://core.svn.wordpress.org/trunk@34530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 23:58:25 +00:00
Drew Jaynes
33a1c0fc16 Docs: Clarify the significance of the $accepted_args parameter value in the documentation for add_filter().
Adds a couple of examples to illustrate callbacks accepting a variable number of arguments.

Fixes #33862.

Built from https://develop.svn.wordpress.org/trunk@34288


git-svn-id: http://core.svn.wordpress.org/trunk@34252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-18 14:53:28 +00:00
Scott Taylor
ef87172270 foreach is a statement, not a function.
See #33491.

Built from https://develop.svn.wordpress.org/trunk@33734


git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 20:28:22 +00:00
Scott Taylor
a0e373ef80 For doc block types, favor bool over the few remaining booleans
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32964


git-svn-id: http://core.svn.wordpress.org/trunk@32935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 01:03:25 +00:00
John Blackbourn
768d8507e5 Correct a typo in the inline docs for add_action().
Props nabil_kadimi, swissspidy
Fixes #32697

Built from https://develop.svn.wordpress.org/trunk@32829


git-svn-id: http://core.svn.wordpress.org/trunk@32800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-18 08:37:25 +00:00
Scott Taylor
19a3aacc94 Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32650


git-svn-id: http://core.svn.wordpress.org/trunk@32620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 15:43:29 +00:00
Scott Taylor
fd04235a04 Add missing doc blocks to plugin.php.
`has_filter()` can use strict comparison when checking `$has` internally.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32615


git-svn-id: http://core.svn.wordpress.org/trunk@32585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-27 15:56:26 +00:00
Scott Taylor
af7a017f46 When calling unset(), it is unnecessary to immediately precede it with a call to isset().
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32545


git-svn-id: http://core.svn.wordpress.org/trunk@32515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-22 05:47:25 +00:00
Dominik Schilling
64fc7294b6 Use HTTPS URLs for codex.wordpress.org.
see #27115.
Built from https://develop.svn.wordpress.org/trunk@32116


git-svn-id: http://core.svn.wordpress.org/trunk@32095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-12 21:29:32 +00:00
Drew Jaynes
31d731cfe4 Fix a typo in the description for the _wp_filter_build_unique_id() DocBlock.
Props lamosty.
Fixes #31732.

Built from https://develop.svn.wordpress.org/trunk@31859


git-svn-id: http://core.svn.wordpress.org/trunk@31838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-22 22:56:27 +00:00
Scott Taylor
b4869ed42f Avoid function calls on each iteration of a for loop.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31678


git-svn-id: http://core.svn.wordpress.org/trunk@31659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-08 23:01:26 +00:00
Scott Taylor
60b0cd7943 The keyword elseif should be used instead of else if so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31090


git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:05:25 +00:00
Boone Gorges
36f36dca77 In remove_all_filters(), only remove callbacks that match the $priority parameter.
Props GeertDD, valendesigns.
Fixes #20920.
Built from https://develop.svn.wordpress.org/trunk@31014


git-svn-id: http://core.svn.wordpress.org/trunk@30995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-31 19:07:24 +00:00
Drew Jaynes
188e47869f Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Markdown-indent a code snippet in the description for `wp_salt()`
* Backtick-escape inline code in the return description for `get_avatar()`
* Various markdown formatting in the description for `add_filter()`
* Markdown-indent a code snippet in the description for `apply_filters()`
* Backtick-escape inline code in the `@see` description for `apply_filters_ref_array()`
* Backtick-escape inline code in the description for `do_action()`
* Backtick-escape variables in the parameter and return descriptions for `do_action_ref_array()`
* Various markdown formatting in the description for `get_plugin_data()`

Props rarst.
See #30473.

Built from https://develop.svn.wordpress.org/trunk@30544


git-svn-id: http://core.svn.wordpress.org/trunk@30533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 06:05:23 +00:00
Drew Jaynes
f8657d5890 Remove redundant and erroneous @uses tag from most core inline documentation.
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.

Fixes #30191.

Built from https://develop.svn.wordpress.org/trunk@30105


git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
Mark Jaquith
e1f2b3b9e2 Use HTTPS URLs for trac.wordpress.org (and use core.trac.wordpress.org)
see #27115
Built from https://develop.svn.wordpress.org/trunk@29789


git-svn-id: http://core.svn.wordpress.org/trunk@29561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 13:37:16 +00:00
Andrew Nacin
b5f0a32baa Unit tests for has_filter() not resetting the array pointer.
props pento.
fixes #29070. see [29472].

Built from https://develop.svn.wordpress.org/trunk@29665


git-svn-id: http://core.svn.wordpress.org/trunk@29439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-02 06:50:15 +00:00
Scott Taylor
d45cde548e After [29422], make sure the internal array counter is not reset for the $wp_filter global.
Props kovshenin.
See #29070.

Built from https://develop.svn.wordpress.org/trunk@29472


git-svn-id: http://core.svn.wordpress.org/trunk@29250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-12 14:47:17 +00:00
Scott Taylor
8f73ec76d1 After [28883], ensure that priorities have callbacks before returning true in has_filter().
Adds unit tests.

Props boonebgorges.
Fixes #29070.

Built from https://develop.svn.wordpress.org/trunk@29422


git-svn-id: http://core.svn.wordpress.org/trunk@29200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 02:30:20 +00:00
Drew Jaynes
e7f7fcbab8 General phpDoc fixes in wp-includes/plugin.php.
See #28516.

Built from https://develop.svn.wordpress.org/trunk@28891


git-svn-id: http://core.svn.wordpress.org/trunk@28690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 09:19:15 +00:00
Sergey Biryukov
341eca6024 List the expected @param type first.
see #28516.
Built from https://develop.svn.wordpress.org/trunk@28889


git-svn-id: http://core.svn.wordpress.org/trunk@28688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 08:47:14 +00:00
Sergey Biryukov
7bb7693dd1 More tweaks to @param docs in wp-includes/plugin.php.
see #28516.
Built from https://develop.svn.wordpress.org/trunk@28888


git-svn-id: http://core.svn.wordpress.org/trunk@28687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 08:42:16 +00:00
Scott Taylor
62075239b8 Update @param docs in plugin.php
Props dkotter.
Fixes #28516.

Built from https://develop.svn.wordpress.org/trunk@28886


git-svn-id: http://core.svn.wordpress.org/trunk@28685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 04:50:15 +00:00
Scott Taylor
0289b98648 After [28883], remove_filter() should set $GLOBALS['wp_filter'][ $tag ] to array() when empty.
Props wonderboymusic, sphoid.
Fixes #28142.

Built from https://develop.svn.wordpress.org/trunk@28884


git-svn-id: http://core.svn.wordpress.org/trunk@28683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 04:38:15 +00:00
Scott Taylor
9275c87190 remove_all_filters() should set to array(), not call unset().
Props nacin, c3mdigital.
Fixes #19306.

Built from https://develop.svn.wordpress.org/trunk@28883


git-svn-id: http://core.svn.wordpress.org/trunk@28682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 04:27:15 +00:00
Drew Jaynes
320b3751a3 Add a missing @since 3.9.0 to the PHPDoc for wp_register_plugin_realpath().
See #16953, #27700.

Built from https://develop.svn.wordpress.org/trunk@28011


git-svn-id: http://core.svn.wordpress.org/trunk@27841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 21:34:14 +00:00
Drew Jaynes
4ed628a7c6 Improve inline documentation for functionality in wp-includes/plugin.php added in 3.9.
See #14994, #27700.

Built from https://develop.svn.wordpress.org/trunk@28010


git-svn-id: http://core.svn.wordpress.org/trunk@27840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 21:30:14 +00:00
Andrew Nacin
0b5729216d Don't try to resolve symlinks for single-file plugins. plugins_url() should not be used in this context anyway.
props rmccue.
fixes #16953.

Built from https://develop.svn.wordpress.org/trunk@27999


git-svn-id: http://core.svn.wordpress.org/trunk@27829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 20:15:15 +00:00
Andrew Nacin
076077383d 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.

Built from https://develop.svn.wordpress.org/trunk@27294


git-svn-id: http://core.svn.wordpress.org/trunk@27150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-26 18:44:14 +00:00
Drew Jaynes
cb8951b0b3 Remove all @package and @subpackage PHPDoc tags not at the file- or class-levels in core.
See #27200.

Built from https://develop.svn.wordpress.org/trunk@27262


git-svn-id: http://core.svn.wordpress.org/trunk@27119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-25 17:14:14 +00:00
Andrew Nacin
5f0981788d Detect and handle symlinking of plugins in plugin_basename().
props rmccue, MikeSchinkel, jdgrimes.
see #16953.

Built from https://develop.svn.wordpress.org/trunk@27158


git-svn-id: http://core.svn.wordpress.org/trunk@27024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-10 23:00:15 +00:00
Drew Jaynes
cd8cedc40d First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin.
Props JustinSainton, SergeyBiryukov, DrewAPicture.
Fixes #26713.

Built from https://develop.svn.wordpress.org/trunk@26868


git-svn-id: http://core.svn.wordpress.org/trunk@26754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-24 18:57:12 +00:00
Andrew Nacin
9dcd0110fb Initialize the filter globals.
props rmccue.
fixes #25378.

Built from https://develop.svn.wordpress.org/trunk@25607


git-svn-id: http://core.svn.wordpress.org/trunk@25524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 19:05:10 +00:00
Peter Westwood
c663f0a925 Clean up the documentation for add_filter and apply_filters.
Fixes #19203 props DrewAPicture, ericlewis

Built from https://develop.svn.wordpress.org/trunk@25476


git-svn-id: http://core.svn.wordpress.org/trunk@25397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-18 07:48:10 +00:00
Andrew Nacin
bb4cc55ccf Close an HTML tag inside the add_filter() inline doc. props johnbillion, fixes #24772.
git-svn-id: http://core.svn.wordpress.org/trunk@24711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-16 13:59:43 +00:00
Andrew Nacin
16f4954b3b Add a delimiter to _wp_filter_build_unique_id()'s handling of static method callbacks. props scribu, fixes #23265.
git-svn-id: http://core.svn.wordpress.org/trunk@24251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-14 15:55:21 +00:00
Sergey Biryukov
ed6941a0f4 Fix several copy/paste errors in register_deactivation_hook() description. props Caspie. fixes #24097.
git-svn-id: http://core.svn.wordpress.org/trunk@23999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-16 09:53:02 +00:00
Helen Hou-Sandí
4e7abbf87b Correct phpdoc for wp-includes/plugin.php: wp-content/plugins/, not wp-content/plugin/. props technosailor. fixes #23024.
git-svn-id: http://core.svn.wordpress.org/trunk@23190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-20 15:49:55 +00:00
nacin
a530304b68 Revert [21287] until #21169 goes through. see #21321.
git-svn-id: http://core.svn.wordpress.org/trunk@21299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-21 20:24:21 +00:00
nacin
ff2d1c5195 Clarify the return value of has_filter() and has_action(). It returns a boolean if only the first argument is specified. If the second argument is specified, it returns false or an integer, which means it may return a non-boolean value that evaluates to false (so, 0), so you should take care to use the === operator.
Correct the function definition of remove_filter() and remove_action(), which 'accepted' an $accepted_args argument, but did not require or use it.

fixes #19417.



git-svn-id: http://core.svn.wordpress.org/trunk@21288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-20 13:54:42 +00:00
nacin
70da9092d4 Remove unnecessary is_null() checks from the worker loops inside do_action(), apply_filters(), etc. fixes #21321. see #21169.
git-svn-id: http://core.svn.wordpress.org/trunk@21287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-20 05:25:37 +00:00
ryan
e3b46b25d3 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00