WC_Meta_Box_Product_Reviews::output
Output the metabox.
Method of the class: WC_Meta_Box_Product_Reviews{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Meta_Box_Product_Reviews::output( $comment );
- $comment(object) (required)
- Comment being shown.
WC_Meta_Box_Product_Reviews::output() WC Meta Box Product Reviews::output code WC 10.7.0
<?php
public static function output( $comment ) {
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
$current = get_comment_meta( $comment->comment_ID, 'rating', true );
?>
<select name="rating" id="rating">
<?php
for ( $rating = 1; $rating <= 5; $rating ++ ) {
printf( '<option value="%1$s"%2$s>%1$s</option>', $rating, selected( $current, $rating, false ) ); // WPCS: XSS ok.
}
?>
</select>
<?php
}