woocommerce_product_variation_title_attributes_separator

woocommerce_product_variation_title_attributes_separator

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_product_variation_title_attributes_separator') is found 5 times:

  • /includes/data-stores/class-wc-product-variation-data-store-cpt.php line 315
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
            }
        }
     
        $should_include_attributes = apply_filters( 'woocommerce_product_variation_title_include_attributes', $should_include_attributes, $product );
        $separator                 = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $product );
        $title_base                = get_post_field( 'post_title', $product->get_parent_id() );
        $title_suffix              = $should_include_attributes ? wc_get_formatted_variation( $product, true, false ) : '';
     
        return apply_filters( 'woocommerce_product_variation_title', $title_suffix ? $title_base . $separator . $title_suffix : $title_base, $product, $title_base, $title_suffix );
    }
  • /src/Admin/API/Reports/Orders/DataStore.php line 386
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
         * Used to determine the separator for products and their variations titles.
         *
         * @since 4.0.0
         */
        $separator = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation );
     
        if ( false === strpos( $product_data['name'], $separator ) ) {
            $attributes            = wc_get_formatted_variation( $variation, true, false );
            $product_data['name'] .= $separator . $attributes;
        }
    }
  • /src/Admin/API/Reports/Segmenter.php line 388
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    foreach ( $segment_objects as $segment ) {
        $id           = $segment->get_id();
        $segments[]   = $id;
        $product_name = $segment->get_name();
        $separator    = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $segment );
        $attributes   = wc_get_formatted_variation( $segment, true, false );
     
        $segment_labels[ $id ] = $product_name . $separator . $attributes;
    }
     
    // If no variations were specified, add a segment for the parent product (variation = 0).
  • /src/Internal/Admin/Loader.php line 416
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    // E.g An extension that added statuses is now inactive or removed.
    $settings['unregisteredOrderStatuses'] = self::get_unregistered_order_statuses();
    // The separator used for attributes found in Variation titles.
    /* phpcs:ignore */
    $settings['variationTitleAttributesSeparator'] = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', new \WC_Product() );
     
    if ( ! empty( $preload_data_endpoints ) ) {
        $settings['dataEndpoints'] = isset( $settings['dataEndpoints'] )
            ? $settings['dataEndpoints']
            : array();
        foreach ( $preload_data_endpoints as $key => $endpoint ) {
  • /src/Internal/Admin/Settings.php line 218
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    }
     
    // The separator used for attributes found in Variation titles.
    //phpcs:ignore
    $settings['variationTitleAttributesSeparator'] = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', new \WC_Product() );
     
    if ( ! empty( $preload_data_endpoints ) ) {
        $settings['dataEndpoints'] = isset( $settings['dataEndpoints'] )
            ? $settings['dataEndpoints']
            : array();
        foreach ( $preload_data_endpoints as $key => $endpoint ) {