WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1855 closed enhancement (fixed)

List classes that extend the current class on the Code Reference

Reported by: grapplerulrich Owned by: coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords:
Cc:

Description

Migrated from an issue filed on the phpdoc-parser repo on GitHub:

List child classes as "Used by" in the parent class

I was interested which classes extend the Walker class.

Change History (4)

#1 @DrewAPicture
3 years ago

Interesting idea. This would be a great feature to implement on the Code Reference. The nice thing is that the parser already stores the parent classes in meta during parsing ('extends'), so it would be a simple query to retrieve that list. And with the auto-linking of known classes, we wouldn't even have to handle that part, just get the list and output it.

Related: #1847, #174

This ticket was mentioned in Slack in #meta-devhub by drew. View the logs.


3 years ago

#3 @coffee2code
3 years ago

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

In 3809:

developer.wordpress.org: For wp-parser-class, list parent class under 'Uses' and list extending classes under 'Used By'.

  • Change post_type_has_uses_info() and post_type_has_usage_info() to return true for 'wp-parser-class' post type.
  • In template-related.php, check that $uses has a value before using it.
  • In get_uses() and get_used_by()`, find classes related via the custom field '_wp-parser_extends', which notes the class being extended.

Fixes #1855.

Note: See TracTickets for help on using tickets.