title: Change posts status to publish based on user role
body: <p>I have members site where users have to pay to subscribe. When user subscribe his role becomes &quot;member&quot; and now can publish to custom post type called &quot;activity&quot;</p>
  <p>However if his subscription stops he automatically reverts to a standard role. The code works with this article: <a href="https://stackoverflow.com/questions/40591580/change-posts-status-to-pending-based-on-user-role">Change posts status to pending based on user role</a></p>
  <p>I would like to do the opposite, on the same model as the article above. Namely: if the user buys a subscription again, all his posts will be published.</p>
  <p>Thank you!</p>