3v4l.org

run code in 300+ PHP versions simultaneously
<?php add_action( 'woocommerce_thankyou', 'my_display_order_data', 20 ); // зацепка в шаблон - просмотр данных заказа add_action( 'woocommerce_view_order', 'my_display_order_data', 20 ); function my_display_order_data( $order_id ){ ?> <h2>Подарок</h2> <table class="shop_table shop_table_responsive additional_info"> <tbody> <tr> <th>Вам подарок:</th> <td><?php echo get_post_meta( $order_id, 'present_inp', true ); ?></td> </tr> </tbody> </table> <?php } add_filter('woocommerce_email_order_meta_fields', 'my_email_order_meta_fields', 10, 3 ); function my_email_order_meta_fields( $fields, $sent_to_admin, $order ) { $fields['present_inp'] = array( 'label' => 'Подарок', 'value' => get_post_meta( $order->id, 'present_inp', true ), ); return $fields; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function add_action() in /in/OiYYH:3 Stack trace: #0 {main} thrown in /in/OiYYH on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.68 ms | 405 KiB | 5 Q