Docs: Clarify the $allowed_protocols default value in various KSES functions.

Add a note that the parameter is optional and defaults to the result of `wp_allowed_protocols()`.

This affects:
* `wp_kses()`
* `filter_block_content()`
* `filter_block_kses()`
* `filter_block_kses_value()`

Includes synchronizing the `$allowed_html` parameter description for consistency.

Follow-up to [649], [6630], [18826], [32603], [43016], [46896], [48478].

Props armondal, SergeyBiryukov.
Fixes #56580.

git-svn-id: https://develop.svn.wordpress.org/trunk@54181 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-09-15 13:27:38 +00:00
parent 777a18d02f
commit 2b4d385298
2 changed files with 25 additions and 21 deletions
+2 -1
View File
@@ -706,7 +706,8 @@ if ( ! CUSTOM_TAGS ) {
* @param array[]|string $allowed_html An array of allowed HTML elements and attributes,
* or a context name such as 'post'. See wp_kses_allowed_html()
* for the list of accepted context names.
* @param string[] $allowed_protocols Array of allowed URL protocols.
* @param string[] $allowed_protocols Optional. Array of allowed URL protocols.
* Defaults to the result of wp_allowed_protocols().
* @return string Filtered content containing only the allowed HTML.
*/
function wp_kses( $string, $allowed_html, $allowed_protocols = array() ) {