Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#30843 closed defect (bug) (fixed)

get_ancestors filter: Parameter is missing

Reported by: tmatsuur's profile tmatsuur Owned by: jorbin's profile jorbin
Milestone: 4.1.1 Priority: normal
Severity: normal Version: 4.1
Component: Posts, Post Types Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

Since English is not good, we will write the main points only.

wp-includes/taxonomy.php: 4335-4345

	/**
	 * Filter a given object's ancestors.
	 *
	 * @since 3.1.0
	 *
	 * @param array  $ancestors     An array of object ancestors.
	 * @param int    $object_id     Object ID.
	 * @param string $object_type   Type of object.
	 * @param string $resource_type Type of resource $object_type is.
	 */
	return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type );

New param $resource_type has not been added.

Attachments (1)

30843.diff (796 bytes) - added by DrewAPicture 10 years ago.

Download all attachments as: .zip

Change History (12)

#1 @DrewAPicture
10 years ago

  • Component changed from General to Posts, Post Types

@tmatsuur: Would you like to create a patch to add the missing parameter?

#2 @tmatsuur
10 years ago

@DrewAPicture: Sorry, I don't know how to create a patch.

@DrewAPicture
10 years ago

#3 @DrewAPicture
10 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.1.1

30843.diff adds the $resource_type parameter to the get_ancestors filter missed in [30141]. See #15029.

#4 follow-up: @DrewAPicture
10 years ago

  • Keywords commit added

#5 in reply to: ↑ 4 @tmatsuur
10 years ago

Replying to DrewAPicture:

Thank you for quick work.

#6 follow-up: @boonebgorges
10 years ago

  • Keywords fixed-major added

[30993] missed the ticket. It fixes the issue for trunk.

While DrewAPicture is correct that this was an error in [30141], I'm unsure whether this should count as a regression that needs to go in 4.1.1, since technically the only thing currently "broken" is a bit of incorrect inline documentation. I'll mark the ticket fixed-major and let the leads decide.

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

#8 in reply to: ↑ 6 @DrewAPicture
10 years ago

Replying to boonebgorges:

[30993] missed the ticket. It fixes the issue for trunk.

While DrewAPicture is correct that this was an error in [30141], I'm unsure whether this should count as a regression that needs to go in 4.1.1, since technically the only thing currently "broken" is a bit of incorrect inline documentation. I'll mark the ticket fixed-major and let the leads decide.

Actually, it's not just a bit of documentation. The parameter doc was added in the original [30141] commit. The only reason I marked this 4.1.1 was because the variable was never added, which would, imo, constitute a bug worth fixing in a point release :)

#9 @boonebgorges
10 years ago

Actually, it's not just a bit of documentation.

Yes, the documentation was added in [30141]. But there is no regression in the code, because the filter here appears exactly as it did in 4.0. That being said, it was definitely a mistake not to have fixed the filter, so a point release fix is fine with me.

#10 @jorbin
10 years ago

  • Owner set to jorbin
  • Resolution set to fixed
  • Status changed from new to closed

In 31084:

Pass $resource_type to 'get_ancestors' filter.

The $resource_type argument was added to the get_ancestors() function in
[30141]. In that changeset, the documentation for the filter was updated to
indicate that it would receive $resource_type as a param, but the filter
itself was not updated accordingly.

Merges [30993] to 4.1 branch

Props tmatsuur, DrewAPicture.
Fixes #30843.

#11 @nacin
10 years ago

In 31476:

Update @since in [31084]. see #30843.

Note: See TracTickets for help on using tickets.