Add woocommerce_order_item_meta_include_all_meta_lines filter

This will be used to determine if all meta lines should be shown in the order-item-meta template.
This commit is contained in:
Thomas Roberts 2021-10-14 17:47:23 +01:00
parent d3421126e7
commit bdf673c86d
No known key found for this signature in database
GPG Key ID: 7C7EC4402EC08F35
1 changed files with 7 additions and 2 deletions

View File

@ -21,7 +21,12 @@ $hidden_order_itemmeta = apply_filters(
)
);
?><div class="view">
<?php if ( $meta_data = $item->get_formatted_meta_data( '' ) ) : ?>
<?php
$include_all = false;
$include_all = apply_filters( 'woocommerce_get_formatted_meta_data_include_all_meta_lines', $include_all, $item );
$meta_data = $item->get_formatted_meta_data( '', $include_all );
?>
<?php if ( $meta_data ) : ?>
<table cellspacing="0" class="display_meta">
<?php
foreach ( $meta_data as $meta_id => $meta ) :
@ -40,7 +45,7 @@ $hidden_order_itemmeta = apply_filters(
<div class="edit" style="display: none;">
<table class="meta" cellspacing="0">
<tbody class="meta_items">
<?php if ( $meta_data = $item->get_formatted_meta_data( '' ) ) : ?>
<?php if ( $meta_data ) : ?>
<?php
foreach ( $meta_data as $meta_id => $meta ) :
if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) {