plugin updates

This commit is contained in:
Tony Volpe
2024-07-16 13:57:46 +00:00
parent 41f50eacc4
commit 8f93917880
1529 changed files with 259452 additions and 25451 deletions

View File

@@ -3994,4 +3994,27 @@ function wc_get_pay_buttons() {
echo '</div>';
}
/**
* Update the product archive title to the title of the shop page. Fallback to
* 'Shop' if the shop page doesn't exist.
*
* @param string $post_type_name Post type 'name' label.
* @param string $post_type Post type.
*
* @return string
*/
function wc_update_product_archive_title( $post_type_name, $post_type ) {
if ( is_shop() && 'product' === $post_type ) {
$shop_page_title = get_the_title( wc_get_page_id( 'shop' ) );
if ( $shop_page_title ) {
return $shop_page_title;
}
return __( 'Shop', 'woocommerce' );
}
return $post_type_name;
}
add_filter( 'post_type_archive_title', 'wc_update_product_archive_title', 10, 2 );
// phpcs:enable Generic.Commenting.Todo.TaskFound