• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2671

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Tutorial Requests
  • Contact
  • Videos
  • Tags
  • Log in

Premium Member? - Request custom code

Move Users Posts To Draft When User Role Changes After Expired Subscription

The code in this tutorial is a extension of the code in this tutorial which enables you to delete the posts of users when their role changes.

When the role of the user is changed to customer ( customer being a custom role ), the status of all posts published by the user will change from published to draft.

So rather than delete the posts when a users subscription expires, this code changes the status of the posts from published to draft.

Here’s the code you can paste at the end of your child themes functions file or in a Must Use plugin.

Register for full access

Roles & Capabilities

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Brad Dalton Specializes In Genesis child theme customization & code modification. Read More…

Learn PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems