Created
April 4, 2019 16:32
-
-
Save Spreeuw/b714f94c36a1b28314c266d8be52234a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if( !empty( $post_meta ) ) { ?> | |
<table class="widefat striped" style="font-family:monospace; text-align:left; width:100%;"> | |
<tbody> | |
<?php foreach( $post_meta as $meta_name => $meta_value ) { ?> | |
<?php | |
if( count( maybe_unserialize( $meta_value ) ) == 1 ) | |
$meta_value = $meta_value[0]; | |
$meta_value = maybe_unserialize( $meta_value ); | |
?> | |
<?php if( is_array( $meta_value ) || is_object( $meta_value ) ) { ?> | |
<tr> | |
<th colspan="3"><?php echo $meta_name; ?></th> | |
</tr> | |
<?php foreach( $meta_value as $inner_meta_name => $inner_meta_value ) { ?> | |
<?php | |
$inner_meta_value = maybe_unserialize( $inner_meta_value ); | |
?> | |
<?php if( is_array( $inner_meta_value ) ) { ?> | |
<tr> | |
<th colspan="3">» <?php echo $inner_meta_name; ?></th> | |
</tr> | |
<?php foreach( $inner_meta_value as $inner_meta_name => $inner_meta_value ) { ?> | |
<tr> | |
<th style="width:20%;">» » <?php echo $inner_meta_name; ?></th> | |
<td><?php echo ( is_array( $inner_meta_value ) ? print_r( $inner_meta_value, true ) : $inner_meta_value ); ?></td> | |
<td> </td> | |
</tr> | |
<?php } ?> | |
<?php } else { ?> | |
<tr> | |
<th style="width:20%;">» <?php echo $inner_meta_name; ?></th> | |
<td><?php echo ( is_array( $inner_meta_value ) || is_object( $inner_meta_value ) ? print_r( $inner_meta_value, true ) : $inner_meta_value ); ?></td> | |
<td> </td> | |
</tr> | |
<?php } ?> | |
<?php } ?> | |
<?php } else { ?> | |
<tr> | |
<th style="width:20%;"><?php echo $meta_name; ?></th> | |
<td><?php echo ( is_array( $meta_value ) || is_object( $meta_value ) ? print_r( $meta_value, true ) : $meta_value ); ?></td> | |
<td class="actions"><?php do_action( 'woo_st_order_data_actions', $post->ID, $meta_name ); ?></td> | |
</tr> | |
<?php } ?> | |
<?php } ?> | |
</tbody> | |
</table> | |
<?php } else { ?> | |
<p>No custom Post meta is associated with this Order.</p> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment