Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
Last active December 13, 2023 13:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tdmrhn/e6102f298566e8dd7ab2229cb4479f62 to your computer and use it in GitHub Desktop.
Blocksy Rename Product Reviews Extension
<?php
add_action( 'init', function () {
global $wp_post_types;
if ( isset( $wp_post_types['blc-product-review'] ) ) {
$wp_post_types['blc-product-review']->label = 'Product Reviews';
$wp_post_types['blc-product-review']->labels->name = 'Product Reviews';
$wp_post_types['blc-product-review']->labels->singular_name = 'Product Review';
$wp_post_types['blc-product-review']->labels->menu_name = 'Product Reviews';
$wp_post_types['blc-product-review']->labels->all_items = 'All Product Reviews';
$wp_post_types['blc-product-review']->labels->add_new = 'Add Product Reviews';
$wp_post_types['blc-product-review']->labels->add_new_item = 'Add Product Review';
$wp_post_types['blc-product-review']->labels->edit_item = 'Edit Product Review';
$wp_post_types['blc-product-review']->labels->new_item = 'Product Review';
$wp_post_types['blc-product-review']->labels->view_item = 'View Product Review';
$wp_post_types['blc-product-review']->labels->search_items = 'Search Product Review';
$wp_post_types['blc-product-review']->labels->not_found = 'No Product Review Found';
$wp_post_types['blc-product-review']->labels->not_found_in_trash = 'No Product Review Found in Trash';
// Update description
$post_type_object = get_post_type_object('blc-product-review');
if ($post_type_object) {
$post_type_object->description = 'This post type is used for managing product reviews on the site.';
}
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment