improve PHPdocs for get_endpoint_title and related hook:

- add @since (original since based on git blame)
- document all params
- add @since for newly-added params
- add docs for woocommerce_endpoint_{$endpoint}_title
This commit is contained in:
Rua Haszard 2020-10-08 09:20:37 +13:00
parent 6032962e59
commit b34ad5be5c
1 changed files with 18 additions and 4 deletions

View File

@ -88,9 +88,12 @@ class WC_Query {
/**
* Get page title for an endpoint.
*
* @param string $endpoint Endpoint key.
* @param string $action Action or variation within the endpoint @since 4.6.0.
* @return string
* @param string $endpoint Endpoint key.
* @param string $action Optional action or variation within the endpoint.
*
* @since 2.3.0
* @since 4.6.0 Added $action parameter.
* @return string The page title.
*/
public function get_endpoint_title( $endpoint, $action = '' ) {
global $wp;
@ -142,7 +145,18 @@ class WC_Query {
break;
}
// TBD - docs for filter.
/**
* Filters the page title used for my-account endpoints.
*
* @since 2.6.0
* @since 4.6.0 Added $action parameter.
*
* @see get_endpoint_title()
*
* @param string $title Default title.
* @param string $endpoint Endpoint key.
* @param string $action Optional action or variation within the endpoint.
*/
return apply_filters( 'woocommerce_endpoint_' . $endpoint . '_title', $title, $endpoint, $action );
}