[wp-hackers] Hook (Filter, Action) Documentation Idea

hakre hanskrentel at yahoo.de
Wed Sep 8 17:27:42 UTC 2010


----- Ursprüngliche Mail ----

> Von: Jacob Santos <wordpress at santosj.name>
> An: wp-hackers at lists.automattic.com
> Gesendet: Mittwoch, den 8. September 2010, 19:01:25 Uhr
> Betreff: Re: [wp-hackers] Hook (Filter, Action) Documentation Idea
> 
> I went around and around with a lot of ideas with hook documentation. In  my
> opinion, I believe a specialized phpdoc type tag would be better. [...] 
> [yeah sure this is a lot of work] [...]
> 
> You'd also have to go
> back and add @uses information  for those fake hook functions or methods.
>
> [...]
> 
> In the end, I just went with @uses  apply_filters and @uses do_action to
> describe the actions and filters. Not  that it is the best way to do it, but
> it works in phpDocumentor and people  can still get the information.

Eh, that's a cool thing. Imagine this:

class WP_Hooks {
  /**
  * Pre Option Filter
  *
  * Description
  *
  * @since 1.5.0
  * @-wp-type  filter
  * @-wp-vary option name
  * @param mixed $value option value
  */
 function pre_site_option_VARY($value) {
 }
}

and where applicable in code:

/* @uses WP_Hooks::pre_site_option_VARY() */

This is somehow inter-operable.

> In your example, there will  still need to be a new parser created.

Regarding your comments on PHPDocumentor, I think it's exensible for own tags, 
at least that should be relativly easy.

And by using the @uses stuff that links into the function definition that can be 
read by PHPDocumentor as well would cross-link that.

-- hakre





More information about the wp-hackers mailing list