WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#9997 closed defect (bug) (invalid)

martian second empty param in apply_filters

Reported by: michelwppi Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

By creating filter for function ( in wp-includes/media.php - line 578)

function img_caption_shortcode($attr, $content = null) {

during debugging, I found the martian empty snd params !

$output = apply_filters('img_caption_shortcode', '', $attr, $content);

where we attempt to find only the two params of the function, there is here this empty martian param and to create the filter (add_filter) it was necessary to create a dummy first param for a total of 3 and so on... I don't find elsewhere in wp core some place where this filter is used..

Is it possible to erase this empty param to be coherent.

Best regards

Michel

NOTE :
it is the same bizarous empty param here in line 611

$output = apply_filters('post_gallery', '', $attr);

Change History (1)

comment:1 @dd326 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Those filters are filtering an empty string.

Its designed to allow plugins to take over the handling for the said function.

If the filter returns data, Then the functions will return that instead, else, the function continues as normal.

The reasoning behind passing an empty string, is because its filtering on the empty string NOT on $attr (Which is just the context of the filter)

Note: See TracTickets for help on using tickets.