Title: reset limit
Last modified: October 11, 2020

---

# reset limit

 *  Resolved [reynskie](https://wordpress.org/support/users/reynskie/)
 * (@reynskie)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/)
 * hi there is there a code to add it to the function.php to reset the limit of 
   the user if the user purchase a product? im using paid membership pro.
 * e.g
    if user 1 purchase product 1 then it limits a user to publish only 5 posts.
   when user used all the 5 posts then purchase back the product 1. can it be the
   limitation reset back to 5 again ?
 * thanks for the response

Viewing 5 replies - 16 through 20 (of 20 total)

[←](https://wordpress.org/support/topic/reset-limit/?output_format=md) [1](https://wordpress.org/support/topic/reset-limit/?output_format=md)
2

 *  Plugin Author [Condless](https://wordpress.org/support/users/condless/)
 * (@condless)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/page/2/#post-13524786)
 * Update the cycle of the users to few days ago, than for the date to be updated
   to the day before the order instead of the day of the order when purchased the
   product, replace the line:
    `update_user_meta( $user_id, 'cycle', $order->get_date_created()-
   >date( 'Y-m-d' ) );` With: `update_user_meta( $user_id, 'cycle', date( 'Y-m-d',
   strtotime( $order->get_date_created()->date( 'Y-m-d' ) . ' - 1 day' ) ) );`
 *  Thread Starter [reynskie](https://wordpress.org/support/users/reynskie/)
 * (@reynskie)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/page/2/#post-13524872)
 * hi condless
 * thanks for the response i really appreciated it.
 * btw the code you provided is not working. it won’t update the cycle date.
 *  Plugin Author [Condless](https://wordpress.org/support/users/condless/)
 * (@condless)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/page/2/#post-13524902)
 * Hi, the code should work, can you try to modify the user’s cycle into 2020-08-
   09 manually and than purchase the product?
 *  Thread Starter [reynskie](https://wordpress.org/support/users/reynskie/)
 * (@reynskie)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/page/2/#post-13524972)
 * hi
 * i set the cycle to 2020-08-09
    then i created a post, the limitation is working
   correctly. [https://prnt.sc/uxzjxz](https://prnt.sc/uxzjxz) when i try to purchased
   it change the date. but not the limitation still 2/2 [https://prnt.sc/uxzmwc](https://prnt.sc/uxzmwc)
 * i try to used the original code from documents.
    the cycle date was changed and
   the limit is change to 0/2, however when i submitted a post its not updating,
   still 0/2 after submitted a post. [https://prnt.sc/uxzpcm](https://prnt.sc/uxzpcm)
    -  This reply was modified 5 years, 7 months ago by [reynskie](https://wordpress.org/support/users/reynskie/).
 *  Plugin Author [Condless](https://wordpress.org/support/users/condless/)
 * (@condless)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/page/2/#post-13537930)
 * Hi,
    As described via Email, the code in the docs was updated so the reset will
   happen only by the end of the day of the purchase. The purpose is to prevent 
   the incorrect posts calculation.

Viewing 5 replies - 16 through 20 (of 20 total)

[←](https://wordpress.org/support/topic/reset-limit/?output_format=md) [1](https://wordpress.org/support/topic/reset-limit/?output_format=md)
2

The topic ‘reset limit’ is closed to new replies.

 * ![](https://ps.w.org/user-posts-limit/assets/icon-256x256.png?rev=2289666)
 * [User Posts Limit](https://wordpress.org/plugins/user-posts-limit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-posts-limit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-posts-limit/)
 * [Active Topics](https://wordpress.org/support/plugin/user-posts-limit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-posts-limit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-posts-limit/reviews/)

 * 20 replies
 * 2 participants
 * Last reply from: [Condless](https://wordpress.org/support/users/condless/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/reset-limit/page/2/#post-13537930)
 * Status: resolved