Automattic\WooCommerce\Internal\Admin\ProductReviews
Reviews::edit_review_parent_file()
Highlights Product -> Reviews admin menu item when editing a review or a reply to a review.
Method of the class: Reviews{}
No Hooks.
Returns
String
.
Usage
$Reviews = new Reviews(); $Reviews->edit_review_parent_file( $parent_file );
- $parent_file(string|mixed) (required)
- Parent menu item.
Notes
- Global. String. $submenu_file
Reviews::edit_review_parent_file() Reviews::edit review parent file code WC 9.8.5
public function edit_review_parent_file( $parent_file ) { global $submenu_file, $current_screen; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $current_screen->id, $_GET['c'] ) && 'comment' === $current_screen->id ) { $comment_id = absint( $_GET['c'] ); $comment = get_comment( $comment_id ); if ( isset( $comment->comment_parent ) && $comment->comment_parent > 0 ) { $comment = get_comment( $comment->comment_parent ); } if ( isset( $comment->comment_post_ID ) && get_post_type( $comment->comment_post_ID ) === 'product' ) { $parent_file = 'edit.php?post_type=product'; $submenu_file = 'product-reviews'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited } } return $parent_file; }