Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#55219 closed defect (bug) (fixed)

"current_theme_supports-{$feature}" filter doesn't run if no $args are passed

Reported by: helgatheviking's profile helgatheviking Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

If there are no args passed to current_theme_supports() then the function terminates early and you never reach the current_theme_supports-{$feature}

See:
https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes/theme.php#L3041-L3043

Attachments (1)

55219.diff (2.6 KB) - added by pavanpatil1 3 years ago.
Created patch

Download all attachments as: .zip

Change History (7)

#1 @azouamauriac
3 years ago

  • Component changed from General to Themes

Hello there, thanks for the repport!

The return was introduced here [12350] while there wasn't filter yet, then the filter come here [19682].

This can be milestone for consideration I think.

#2 @SergeyBiryukov
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.0

Thanks for the ticket! Good catch, this seems like an oversight.

@pavanpatil1
3 years ago

Created patch

#3 @pavanpatil1
3 years ago

  • Keywords has-patch added; needs-patch removed
  • Resolution set to invalid
  • Status changed from new to closed

#4 @pavanpatil1
3 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#5 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Status changed from reopened to reviewing

#6 @SergeyBiryukov
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 52812:

Themes: Make sure the current_theme_supports-{$feature} filter is consistently applied.

Previously, the filter was not applied if there are no arguments passed to current_theme_supports().

Follow-up to [12350], [19682].

Props helgatheviking, azouamauriac, pavanpatil1, SergeyBiryukov.
Fixes #55219.

Note: See TracTickets for help on using tickets.