Title: Attachments lock doesn&#8217;t work
Last modified: June 22, 2020

---

# Attachments lock doesn’t work

 *  Resolved [crashseo](https://wordpress.org/support/users/crashseo/)
 * (@crashseo)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/attachments-lock-doesnt-work/)
 * Hello,
    The plugin works very fine on articles and pages. But on attachment it
   doesn’t work, i can’t save the product association. It loads normal in backend,
   i’m selecting the product, but after i hit save it shows “saved” but the field
   becomes again empty and the content is not restricted. Can you help me?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/attachments-lock-doesnt-work/#post-13019000)
 * This is the first time I have actually tried this but you are 100% correct. It
   appears that the wordpress save_post function does not get called when saving
   attachments.
 * I haven’t done any testing on this yet but at my first quick test it appears 
   to work. Can you try the following for me.
 * In `plugins/woocommerce-pay-per-post/includes/class-woocommerce-pay-per-post.
   php` on line 38, right below `$this->loader->add_action( 'save_post', $plugin_admin,'
   save_meta_box' );` add this line
 * `$this->loader->add_action( 'edit_attachment', $plugin_admin, 'save_meta_box');`
 * After you do that, try to save the product information on your attachment and
   let me know if it all works out for you. If it does then I will do a bit more
   research and testing and implement this into an upcoming release.

Viewing 1 replies (of 1 total)

The topic ‘Attachments lock doesn’t work’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pay-per-post/assets/icon-256x256.png?rev=2252656)
 * [Pay For Post with WooCommerce](https://wordpress.org/plugins/woocommerce-pay-per-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pay-per-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pay-per-post/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pay-per-post/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/attachments-lock-doesnt-work/#post-13019000)
 * Status: resolved