Phil
Forum Replies Created
-
So my setup is a little custom.
Using tribe Events Tickets Plus plugin.
This allows creation of tickets on any WP page or post (I’m using a custom post type).
When you create tickets, they create separate Woocommerce products. I have added the PPOM fields onto those products.
On the front-end, the page with tickets aggregates them onto one page, but they are still separate products to Woocommerce.
I’m finding as seen in my first post, that the datepicker for the date field is only saving the last date used when multiple tickets with dofferent dates are selected. I assume it’s a javascript issue being saved to the input – rather than having different unique classes to save data against. Maybe product ID would be a good one for a unique ID perhaps?
Forum: Plugins
In reply to: [Helpful] Small text bugIt does, but it seems to cut a character off the end of the word.
How it’s set: https://imgur.com/IoCbNKl
How it displays: https://imgur.com/AOS23Os
Can confirm this has stopped working on all my clients sites using the Honeypot plugin. They are receiving Russian spam even with a renamed honeypot field.
Forum: Plugins
In reply to: [Invoices for WooCommerce] Logo not saving since updateThe one that was working before (that now won’t re-upload/save) is a .png, 384 × 68px, 5kb.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labels<3
So it came down to it requiring this line:
$formatted_meta = $class->get_formatted( '_' );Thanks dude, much appreciated.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsNope, this is literally the entire thing:
// define the woocommerce_order_items_meta_display callback function filter_wps_order_items_meta_display( $output, $this, $formatted_meta ) { $meta_list = array(); foreach ( $formatted_meta as $meta ) { $meta_list[] = '<dd class="variation">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd>'; } $output = '<dl class="variation">' . implode( '', $meta_list ) . '</dl>'; return $output; }; // add the filter add_filter( 'woocommerce_order_items_meta_display', 'filter_wps_order_items_meta_display', 10, 3 );Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsHi,
Still just outputs empty:
<dl class="variation"></dl> <dl class="variation"></dl>Seems to be outputting the <dl> as foreach, rather than it being the container and inner <dd>’s, which should be the foreach loop, no?
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsHi Mike,
It just outputs it empty:
<dl class="variation"></dl> <dl class="variation"></dl>So the filter works, it’s just not outputting the meta values. Here’s the filter:
// define the woocommerce_order_items_meta_display callback function filter_wps_order_items_meta_display( $output, $this, $formatted_meta ) { foreach ( $formatted_meta as $meta ) { $meta_list[] = ' <dd class="variation">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd> '; } $output = '<dl class="variation">' . implode( '', $meta_list ) . '</dl>'; return $output; }; // add the filter add_filter( 'woocommerce_order_items_meta_display', 'filter_wps_order_items_meta_display', 10, 2 );Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsJust can’t get this working. It either adds the new ones in addition to the existing or just doesn’t display at all.
// define the woocommerce_order_items_meta_display callback function filter_wps_order_items_meta_display( $output, $this, $formatted_meta ) { foreach ( $formatted_meta as $meta ) { $meta_list[] = ' <dd class="variation">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd> '; } $output .= '<dl class="variation">' . implode( '', $meta_list ) . '</dl>'; return $output; }; // add the filter add_filter( 'woocommerce_order_items_meta_display', 'filter_wps_order_items_meta_display', 10, 2 );Am I missing something here?
Ignore, I got it working.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labels// define the woocommerce_order_items_meta_display callback function filter_wps_order_items_meta_display( $output, $instance ) { $instance = ' <dt class="variationz-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( $meta['label'] ) . ':</dt> <dd class="variationz-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd> '; $output .= '<dl class="variation">' . implode( '', $instance ) . '</dl>'; return $output; }; // add the filterForum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsOk, I’ve figured out the hook:
function filter_wps_order_items_meta_display( $output, $this ) { return $output; }; add_filter( 'woocommerce_order_items_meta_display', 'filter_wps_order_items_meta_display', 10, 2 );which I can see works, but how do I strip the HTML tags off this?
$meta_list[] = '<dt class="variation-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( $meta['label'] ) . ':</dt> <dd class="variation-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd> ';I’ve tried numerous ways of doing this trying to add a modified $meta_list array but it just seems to add it to the end of the default output rather than replacing it.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsOk, I’ve adapted to this but it still isn’t working.
function wps_order_items_meta_display($meta_list) { $meta_list[] = ' <dt class="variation-test-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( $meta['label'] ) . ':</dt> <dd class="variation-test-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd> '; return $meta_list; } add_filter('woocommerce_order_items_meta_display', 'wps_order_items_meta_display');Do I need to deregister the original filter?
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product Meta – Strip dd and dt labelsLike this?
add_filter('woocommerce_order_items_meta_display', 'wps_order_items_meta_display'); function wps_order_items_meta_display( $flat = false, $return = false, $hideprefix = '_', $delimiter = ", \n" ) { $output = ''; $formatted_meta = $this->get_formatted( $hideprefix ); if ( ! empty( $formatted_meta ) ) { $meta_list = array(); foreach ( $formatted_meta as $meta ) { if ( $flat ) { $meta_list[] = wp_kses_post( $meta['label'] . ': ' . $meta['value'] ); } else { $meta_list[] = ' <dt class="variationz-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( $meta['label'] ) . ':</dt> <dd class="variationz-' . sanitize_html_class( sanitize_text_field( $meta['key'] ) ) . '">' . wp_kses_post( wpautop( make_clickable( $meta['value'] ) ) ) . '</dd> '; } } if ( ! empty( $meta_list ) ) { if ( $flat ) { $output .= implode( $delimiter, $meta_list ); } else { $output .= '<dl class="variationz">' . implode( '', $meta_list ) . '</dl>'; } } } $output = apply_filters( 'woocommerce_order_items_meta_display', $output, $this ); if ( $return ) { return $output; } else { echo $output; } }Forum: Fixing WordPress
In reply to: [HookPress] HookPress killed my wordpress siteMaybe try posting this in the plugins support thread.
https://wordpress.org/support/plugin/hookpress