From b34ad5be5c1f6664607d334c5da46e86cb03fa69 Mon Sep 17 00:00:00 2001 From: Rua Haszard Date: Thu, 8 Oct 2020 09:20:37 +1300 Subject: [PATCH] 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 --- includes/class-wc-query.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/includes/class-wc-query.php b/includes/class-wc-query.php index 3a1fc999ddd..1f2e331d106 100644 --- a/includes/class-wc-query.php +++ b/includes/class-wc-query.php @@ -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 ); }