digitalbeans
Forum Replies Created
-
Forum: Plugins
In reply to: [Post Update Add-On - Gravity Forms] No clue how to use thisHi Jason,
Thanks for the hints in your last update, currently working on trying to do this myself based on your notes. Do you think it might be possible for you (or anyone reading this thread) to do a quick Loom video on how you got it working?
The dev documentation is so very vague and I’ve been trying different things intermittently over the last month! :0)
Thanks team @elextensions , much appreciated! ??
Please ignore this, I got there in the end :0)
add_action('admin_init', 'my_acf_update_bidirectional_posts'); function my_acf_update_bidirectional_posts(){ // bail early if ajax request if(wp_doing_ajax()){ return; } // Retrieve all users $get_users = get_users(array( 'number' => '-1', )); // Bail early if not found if(empty($get_users)){ return; } // Force bidirectional update add_filter('acfe/bidirectional/force_update', '__return_true'); // Loop foreach($get_users as $user_id){ // Retrieve unformatted value $my_field = get_field('field_6185189802029', $user_id, false); // Re-update the same value to force the update on the other side update_field('field_6185189802029', $my_field, $user_id); } }
I will set up a Cron job for this to run every so often.
Thanks for the great plugin!
I will work on it using your documentation now – it’s very in-depth, thanks very much for this!
As a temporary fix (in case anyone read the thread), I used this crude solution:
add_filter( 'woocommerce_new_order_note_data', 'filter_woocommerce_new_order_note_data', 10, 2 ); function filter_woocommerce_new_order_note_data( $args, $args2 ) { if( ! $args2['is_customer_note'] && is_user_logged_in() && current_user_can( 'edit_shop_order', $args2['order_id'] ) ){ $user = get_user_by( 'id', get_current_user_id() ); $args['comment_author'] = $user->display_name; $args['comment_author_email'] = $user->user_email; } return $args; }
A better solution can be created using the link from the author.
Thanks again!