* Just remove . from description

* Use trim instead ht Jeff.

Co-authored-by: Timmy Crawford <timmydcrawford@gmail.com>
This commit is contained in:
Paul Sealock 2020-10-17 08:10:29 +13:00 committed by GitHub
parent 91e3e7336d
commit 146f22aabe
1 changed files with 4 additions and 5 deletions

View File

@ -167,11 +167,10 @@ class Controller extends \WC_REST_Reports_Controller {
continue;
}
$stat = $prefix . '/' . $property_key;
$this->allowed_stats[] = $stat;
$stat_label = empty( $schema_info['title'] ) ? $schema_info['description'] : $schema_info['title'];
$this->labels[ $stat ] = trim( preg_replace( '/\W+/', ' ', $stat_label ) );
$stat = $prefix . '/' . $property_key;
$this->allowed_stats[] = $stat;
$stat_label = empty( $schema_info['title'] ) ? $schema_info['description'] : $schema_info['title'];
$this->labels[ $stat ] = trim( $stat_label, '.' );
$this->formats[ $stat ] = isset( $schema_info['format'] ) ? $schema_info['format'] : 'number';
}