Skip to content

Instantly share code, notes, and snippets.

@1ucay
1ucay / function.php
Last active September 9, 2016 11:20
Woocommerce product variation nicename in Cart and Order
add_filter( 'woocommerce_get_item_data', 'woocommerce_get_item_data', 10, 2);
function woocommerce_get_item_data($item_data, $cart_item) {
$variation = $cart_item['variation'];
// Format item data ready to display
foreach ( $item_data as $key => $data ) {
// Set hidden to true to not display meta on cart.
if ( ! empty( $data['hidden'] ) ) {
unset( $item_data[ $key ] );
continue;
@1ucay
1ucay / functions.php
Last active June 17, 2016 16:38
Advanced Custom Fields aka ACF - more hide on screen checkboxes for plugin
<?php
add_action('acf/render_field_group_settings', 'acf_hide_metabox', 10, 1);
function acf_hide_metabox( $field_group ) {
acf_render_field_wrap(array(
'label' => __('Hide on screen for plugins','acf'),
'type' => 'checkbox',
'name' => 'hide_on_screen_plugin',
'prefix' => 'acf_field_group',
'value' => $field_group['hide_on_screen_plugin'],