WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#41760 new enhancement

wp_list_comments callback params

Reported by: milana_cap Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Comments Keywords: dev-feedback
Focuses: template Cc:
PR Number:

Description

In wp-includes/class-walker-comment.php, methods comment() and html5_comment() have following order of @params: $comment, $depth, $args.

However, when you try to modify comment markup using callback argument for wp_list_comments(), order of params is $comment, $args, $depth.

Is it possible to make the same order of params?

Change History (2)

#1 @milana_cap
2 years ago

  • Keywords dev-feedback added

#2 @ayeshrajans
2 years ago

It certainly makes sense to have semantic parameter order I totally agree. However, I'm afraid changing the callback arguments will introduce a lot of backwards incompatibility issues, and I doubt the implementors will be happy we changed the parameter order purely for the semantic purposes.

https://github.com/search?l=PHP&q=wp_list_comments+callback%3D&type=Code&utf8=✓ here is a fuzzy GitHub search for the function call with callback parameter.

Both class methods you mentioned are protected methods, which means if we change the parameter order of those two methods, we would only need to change the current class and it's subclasses.

Note: See TracTickets for help on using tickets.