#53113 closed defect (bug) (fixed)
class-walker-comment.php has call to remove_filter with incorrect number of arguments
Reported by: | diddledani | Owned by: | davidbaumwald |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Line 203:
remove_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 );
Should be:
remove_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40 );
(github PR will be attached)
Change History (8)
This ticket was mentioned in PR #1213 on WordPress/wordpress-develop by diddledan.
3 years ago
#1
#2
@
3 years ago
- Component changed from General to Comments
- Keywords commit added
- Milestone changed from Awaiting Review to 5.8
- Owner set to davidbaumwald
- Status changed from new to reviewing
Good catch! Introduced in [47887].
#3
@
3 years ago
Hi there!
Can you please update PR and do the below change also?
https://github.com/WordPress/WordPress/blob/master/wp-includes/class-walker-comment.php#L185
add_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 );
Replace to
add_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40 );
#4
@
3 years ago
@mukesh27 that add_filter
call looks correct to me. Why do you think we need to drop the priority?
#5
@
3 years ago
As @diddledan mentions, I think the add_filter
is correct, as it's passing 2 params to filter_comment_text
. This ticket deals with removing a filter, which doesn't care about the param count.
@SergeyBiryukov commented on PR #1213:
2 months ago
#8
Thanks for the PR! This was merged in r50816.
Nit:
remove_filter
takes 3 parameters with 4 given. This might cause a PHP Warning message.Trac ticket: https://core.trac.wordpress.org/ticket/53113