Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

add action save post type and update post meta woocommerce

I solved:

add_action('save_post_product', 'update_post_meta_subito', 10, 3 );

function update_post_meta_subito($post_id){

    $prova_termine="inzaghi";


    $term_taxonomy_ids = wp_set_object_terms( $post_id, $prova_termine, 'pa_autore', true );

    $thedata = Array(

    'pa_autore'=>Array( 
    'name'=>'pa_autore', 
    'value'=>$prova_termine,
    'is_visible' => '1',
    'is_variation' => '1',
    'is_taxonomy' => '1'
    ),


    );


    update_post_meta( $post_id, '_product_attributes',$thedata);

}

Related Posts:

  1. Query for posts from any post type but only add instock products
  2. changing meta value and meta key of price field
  3. Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
  4. I am having a problem with fetching product data in the Gutenberg block editor
  5. Query all posts where a meta key does not exist
  6. Can the Next/Prev Post links be ordered by menu order or by a meta key?
  7. what is the correct way to compare dates in a WP query_posts meta_query
  8. Advanced search form with filters for custom taxonomies and custom fields
  9. Meta query with boolean true/false value
  10. Get post with multiple meta keys and value
  11. Correctly delete posts with meta and attachments [duplicate]
  12. Storing revisions of metadata for custom post type
  13. Custom field values deleted when trashing custom post type
  14. How to get all custom fields of any post type
  15. Update CPT meta data using REST API
  16. Admin Area Custom Type Search By Meta Fields Without Title & Content
  17. Echo all meta keys of a custom-post TYPE
  18. Custom Post type – how to get checkbox to update meta field to null
  19. How can I filter posts by post_parent in the admin?
  20. How do I Paginate Search Results for Custom Post Types?
  21. Ordering posts having multiple post-meta date fields
  22. Custom Post Type with Input fields to seperate table on database.
  23. How do I remove all the metaboxes for a custom post type?
  24. Custom Queries: Joining On Meta Values From Two Custom Post Types
  25. Gutenberg how to make attribute to save to meta
  26. Attach a Custom Post Type to a Woocommerc product as a variation or add-on [closed]
  27. How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
  28. Post metadata deletes itself
  29. How to create a mini directory in WordPress?
  30. How Can I save multiple records in same meta key?
  31. Exclude a term of a taxonomy with a custom post type in a search
  32. Get all posts from custom post type and insert in select input as metabox
  33. Detect meta value changes when post is updated (post_updated)
  34. Search everything (posts, pages, tags, cpt, meta)
  35. Permalinks using event date (year & month) instead of publication date
  36. Custom Post Type: Set post_title equal to a custom post type field
  37. I can’t set meta_key in my custom post type query
  38. Grossly inefficient wordpress loops!
  39. Compare 3 custom fields and sort by oldest
  40. How Do I Use WP_Query to Run This Database Query as Search Result?
  41. How to solve suspected memory issue in custom WordPress loop?
  42. WordPress Admin Panel search posts with custom post meta values along with title
  43. Creating a custom post type upon registration
  44. How to Update post status using meta data in Custom post TYpe
  45. Rest Api v2 orderby meta_key in custom post type
  46. bulk Update post_meta with default values
  47. Reason action hook won’t work with update_post_meta from frontend form? Alternative?
  48. Can’t sort order of wp_query with 2 meta keys
  49. Showing Meta Data for Custom Post Types?
  50. How to get source of custom meta image?
  51. Having trouble with custom post type / meta box
  52. How can I include meta box content when searching?
  53. update a post meta from a single table cell TablePress
  54. update custom post type meta from a shortcode
  55. Custom Meta Boxes – Nonce Issue – Move to trash issue
  56. Displaying Meta Box Image
  57. WooCommerce – Show orders for a specific product ? [closed]
  58. Custom post type category not displaying in custom post type
  59. How to make custom post meta wp_editor translatable?
  60. Automatically adding meta data to posts or multiple query help
  61. How to keep a check box in custom meta box for custom post type checked by default for add new post?
  62. How to add multiple featured image in meta box in post editor?
  63. Show metabox in custom-post-template depending on taxonomy term?
  64. Set meta_query only for specific post type
  65. get_terms won’t display product_cat or any other custom taxonomies when specified
  66. ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
  67. update_post_meta() whenever custom post type is updated
  68. Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
  69. Trigger “unsaved changes” dialog for custom post meta changes
  70. Using date stored as custom field to filter posts displayed in admin
  71. Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
  72. Displaying custom posts only if custom meta box’s date is not expired
  73. Displaying Metabox value (custom post type taxonomy)
  74. How do I sort a custom post type admin column using two meta keys?
  75. Add Post Url to Manage Edit Screen
  76. Woocommerce query specific product from specific category
  77. How to best delete orphan wp_postmeta
  78. How can I display my custom metaboxes on a custom post template?
  79. Display all custom post type posts and order them by an optional meta_key
  80. Meta Box Only in CPT Edit Page, Not in Add New
  81. Problem adding column to WC Subscription [closed]
  82. get_post_meta is returning image id
  83. Custom Post Type, Saving Multiple Checkboxes
  84. get_template_part() – post-meta not working?
  85. How can I get_post_meta() in the most efficient way?
  86. need advice on how to do a lists using custom post types – taxonomy vs postmeta
  87. Count posts with specific term_meta
  88. Custom search for custom post meta with pre_get_posts interferes with WP search
  89. Create a random unique 6 digit number as custom field for custom post type
  90. Export entries and multiple custom field meta to .csv?
  91. how to interconnect custom post types?
  92. WordPress Orderby Numeric Value Not Working
  93. Custom Post Status Transition Issues With Get Post Meta
  94. Create custom post type on successful woocommerce order [closed]
  95. Replace title column in post list with post meta value
  96. Metadata for a taxonomy – is there any WordPress way of doing this?
  97. My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
  98. List all images from a single post meta value
  99. Does WordPress limit the length of slug names for Post Meta or Terms?
  100. orderby in custom WP Query does not work
Categories custom-post-types Tags custom-post-types, post-meta, woocommerce-offtopic
Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
RSS feed has stopped updating

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress