Variation Names: Allow long names to be shown (https://github.com/woocommerce/woocommerce-admin/pull/4715)

This commit is contained in:
Paul Sealock 2020-07-08 15:25:51 +12:00 committed by GitHub
parent 9ecb76635f
commit d0460c2f08
2 changed files with 16 additions and 0 deletions

View File

@ -130,6 +130,14 @@ class DataStore extends ProductsDataStore implements DataStoreInterface {
$data = $this->get_cached_data( $cache_key );
if ( false === $data ) {
// Ensure full variation titles are queried.
add_filter(
'woocommerce_product_variation_title_include_attributes',
function() {
return true;
}
);
$this->initialize_queries();
$selections = $this->selected_columns( $query_args );

View File

@ -174,6 +174,14 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
* @param array $query_args Query parameters.
*/
protected function include_extended_info( &$products_data, $query_args ) {
// Ensure full variation titles are queried.
add_filter(
'woocommerce_product_variation_title_include_attributes',
function() {
return true;
}
);
foreach ( $products_data as $key => $product_data ) {
$extended_info = new \ArrayObject();
if ( $query_args['extended_info'] ) {