Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56285 closed defect (bug) (fixed)

export_preview_data() added wrongly

Reported by: drivingralle's profile Drivingralle Owned by: sergeybiryukov's profile sergeybiryukov
Milestone: 6.1 Priority: normal
Severity: trivial Version: 4.5
Component: Customize Keywords: has-patch commit
Focuses: Cc:

Description

The method export_preview_data() in WP_Customize_Nav_Menus is added as a filter to the hook wp_footer (https://developer.wordpress.org/reference/hooks/wp_footer/) as a filter but it's a action hook.

Tiny bug. I'll attach a patch.

Attachments (1)

wp-footer.patch (1.0 KB) - added by Drivingralle 2 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
2 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 6.1
  • Version set to 4.5

Good catch, thanks! This does not affect anything in practice, but makes sense to correct for better semantics.

Introduced in [36889] / #27355. A similar instance in the WP_Customize_Widgets class, added in [27419] / #27112, already uses the correct function.

#2 @mukesh27
2 years ago

  • Owner set to sergeybiryukov
  • Status changed from new to assigned

The changes make sense to me. Assign commit to Sergey.

#3 @jorbin
2 years ago

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

In 54120:

Customize: Use Semantically correct function

Functionally, add_action and add_filter are essentially the same, but semantically they are not.

Props Drivingralle.
Fixes #56285.

#4 @peterwilsoncc
2 years ago

@mukesh27 @SergeyBiryukov added to props via make/core per review comments above.

Note: See TracTickets for help on using tickets.