Title: nickbreen's Replies | WordPress.org

---

# nickbreen

  [  ](https://wordpress.org/support/users/nickbreen/)

 *   [Profile](https://wordpress.org/support/users/nickbreen/)
 *   [Topics Started](https://wordpress.org/support/users/nickbreen/topics/)
 *   [Replies Created](https://wordpress.org/support/users/nickbreen/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/nickbreen/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/nickbreen/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/nickbreen/engagements/)
 *   [Favorites](https://wordpress.org/support/users/nickbreen/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Loushou: ACF for WooCommerce] Previous form entry visible on next form view](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/)
 *  Thread Starter [nickbreen](https://wordpress.org/support/users/nickbreen/)
 * (@nickbreen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/#post-8619684)
 * Any update on this issue?
 * The issue makes this plugin fundamentally unusable on a woocommerce installations
   with concurrent orders and/or sensitive data collection.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Loushou: ACF for WooCommerce] Previous form entry visible on next form view](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/)
 *  Thread Starter [nickbreen](https://wordpress.org/support/users/nickbreen/)
 * (@nickbreen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/#post-8491649)
 * Hmm, I’d thought I’d posted a suggestion for this a month ago… apparently not.
 * The core of the problem is that prior to checkout submission there is no post
   ID to store the custom field data against and the implementation temporarily 
   stores the data in wp_options with a _non-unique_ key.
 * The simplest change to make is to randomise the storage of the data in options.
   Perhaps by:
    # use a nonce value, [https://codex.wordpress.org/Function_Reference/wp_nonce_field](https://codex.wordpress.org/Function_Reference/wp_nonce_field)#
   Use this value to generate the name of the wp_options record # Reconstruct the
   data from the option on form submission.
 * Alternatively store the data against an actual CPT entry and substitute for the
   order afterwards.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Loushou: ACF for WooCommerce] Previous form entry visible on next form view](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/)
 *  Thread Starter [nickbreen](https://wordpress.org/support/users/nickbreen/)
 * (@nickbreen)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/#post-8343091)
 * The issue keeps re-occurring with `checkout_0_*` and `_checkout_0_*` options 
   persisting in the DB. E.g.
 *     ```
       $ wp option list --search=*checkout_0_*
       +---------------------------------------------------+--------------------------+
       | option_name                                       | option_value             |
       +---------------------------------------------------+--------------------------+
       | checkout_0_passenger_0_name                       | [REDACTED]               |
       | _checkout_0_passenger_0_name                      | field_57f87d67f77e7      |
       | checkout_0_passenger_0_dob                        | [REDACTED]               |
       | _checkout_0_passenger_0_dob                       | field_57f87d76f77e8      |
       | checkout_0_passenger_0_age                        | [REDACTED]               |
       | _checkout_0_passenger_0_age                       | field_57f87d88f77e9      |
       | checkout_0_passenger_0_gender                     | [REDACTED]               |
       | _checkout_0_passenger_0_gender                    | field_57f87d98f77ea      |
       | checkout_0_passenger_0_nationality                | [REDACTED]               |
       | _checkout_0_passenger_0_nationality               | field_57f87daaf77eb      |
       | checkout_0_passenger_0_address                    | [REDACTED]               |
       | _checkout_0_passenger_0_address                   | field_57f87dc6f77ec      |
       | checkout_0_passenger                              | 1                        |
       | _checkout_0_passenger                             | field_57f87d40e2864      |
       +---------------------------------------------------+--------------------------+
       ```
   
 * * It’d be safe to use transients rather than ordinary options, so they also get
   an expiry.
    * The event(s) that clear these values do not seem to fire consistently.
    -  This reply was modified 9 years, 9 months ago by [nickbreen](https://wordpress.org/support/users/nickbreen/).
      Reason: formatting
    -  This reply was modified 9 years, 9 months ago by [nickbreen](https://wordpress.org/support/users/nickbreen/).
      Reason: formatting
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Loushou: ACF for WooCommerce] Previous form entry visible on next form view](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/)
 *  Thread Starter [nickbreen](https://wordpress.org/support/users/nickbreen/)
 * (@nickbreen)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/#post-8306252)
 * Found this support ticket [https://support.advancedcustomfields.com/forums/topic/front-end-form-values-staying-filled/](https://support.advancedcustomfields.com/forums/topic/front-end-form-values-staying-filled/)
 * Relevant answer:
 * >  Can you check your wp_options table for any rows where the option_name starts
   > with ‘new_’ or ‘options_new_’.
   > It is possible that during testing, your code saved it’s values with a post_id
   > of ‘new’ and now your post is loading from ‘new’.
   > If the rows exist in the DB. Please remove them, and your form should clear
   > out.
 * It’s a mystery why those options persisted, but deleting solved the problem, 
   though I’m not confident that the problem won’t happen again.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Loushou: ACF for WooCommerce] Previous form entry visible on next form view](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/)
 *  Thread Starter [nickbreen](https://wordpress.org/support/users/nickbreen/)
 * (@nickbreen)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/previous-form-entry-visible-on-next-form-view/#post-8306151)
 * ACF version is 5.3.1, as of writing 5.4.7 is current.
 * I’ve debugged and isolated the issue down to the storage of checkout values as
   WP Options due to the order not existing yet when at the checkout. The “fake”`
   post_id` used to store the checkout fields is `"checkout_" . $post_id` which 
   is always `checkout_0` as there is no post/order yet.
 * When anyone goes to the checkout, if there are `checkout_0_*` options then they
   get loaded!
    -  This reply was modified 9 years, 9 months ago by [nickbreen](https://wordpress.org/support/users/nickbreen/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Missing arguments for action/filters](https://wordpress.org/support/topic/missing-arguments-for-actionfilters/)
 *  Thread Starter [nickbreen](https://wordpress.org/support/users/nickbreen/)
 * (@nickbreen)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/missing-arguments-for-actionfilters/#post-7544504)
 * This is using the `Simple` template, unaltered.
 * I hacked around this experimentally after inspecting the `Simple/invoice.php`
   and using `global $wpo_wcpdf;` and referencing `$wpo_wcpdf->export->order` directly
   in the `wpo_wcpdf_before_order_details` action function.
 * This of course doesn’t work for `item` in the `wpo_wcpdf_after_item_meta` action.
 * … some time passes, and I actually read [https://developer.wordpress.org/reference/functions/add_action/](https://developer.wordpress.org/reference/functions/add_action/)
   and realise that I’m Just Doing It Wrong as I’m missing the `$accepted_args` 
   argument.
 *     ```
       add_action('wpo_wcpdf_before_item_meta', function ($template_type, $item, $order) {
         echo "<span class=\"item-meta\">{$item['single_price']}</span>";
       }, 10, 3);
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)