plugin updates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user