Skip to content

Commit

Permalink
Docs: Update pre_do_shortcode_tag and do_shortcode_tag filter Doc…
Browse files Browse the repository at this point in the history
…Blocks.

This reflects the return type change of `shortcode_parse_atts()` from `array|string` to `array` in WordPress 6.5.

Follow-up to [38506], [38713], [39665], [55711], [57597], [58168].

Props marherumr.
Fixes #61288.

git-svn-id: https://develop.svn.wordpress.org/trunk@58197 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed May 25, 2024
1 parent 581f8d5 commit 3ba4c4c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/wp-includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,11 @@ function do_shortcode_tag( $m ) {
* shortcode generation process, returning that value instead.
*
* @since 4.7.0
* @since 6.5.0 The `$attr` parameter is always an array.
*
* @param false|string $output Short-circuit return value. Either false or the value to replace the shortcode with.
* @param string $tag Shortcode name.
* @param array|string $attr Shortcode attributes array or the original arguments string if it cannot be parsed.
* @param array $attr Shortcode attributes array, can be empty if the original arguments string cannot be parsed.
* @param array $m Regular expression match array.
*/
$return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );
Expand All @@ -436,11 +437,12 @@ function do_shortcode_tag( $m ) {
* Filters the output created by a shortcode callback.
*
* @since 4.7.0
* @since 6.5.0 The `$attr` parameter is always an array.
*
* @param string $output Shortcode output.
* @param string $tag Shortcode name.
* @param array|string $attr Shortcode attributes array or the original arguments string if it cannot be parsed.
* @param array $m Regular expression match array.
* @param string $output Shortcode output.
* @param string $tag Shortcode name.
* @param array $attr Shortcode attributes array, can be empty if the original arguments string cannot be parsed.
* @param array $m Regular expression match array.
*/
return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );
}
Expand Down Expand Up @@ -600,7 +602,7 @@ function get_shortcode_atts_regex() {
* retrieval of the attributes, since all attributes have to be known.
*
* @since 2.5.0
* @since 6.5.0 The function now always returns an empty array,
* @since 6.5.0 The function now always returns an array,
* even if the original arguments string cannot be parsed or is empty.
*
* @param string $text Shortcode arguments list.
Expand Down

0 comments on commit 3ba4c4c

Please sign in to comment.