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

WP SITES

2787

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Checkout
  • Cart
  • Videos

Change Post Status From Published To Draft For Standard Posts & Custom Post Types – WordPress

$75.00

Category: WordPress Tag: Roles and Capabilities
  • Description

This code changes the posts status of published standard posts and published CPT items.

  • The Publish status is changed when the user role changes from editor to a custom role named customer which has the same capabilities as a subscriber.
  • The Publish status changes for both standard posts & CPT items published by the editor.
  • The code works with any plugin that create custom post types.

Installation

  1. Copy & paste the PHP code to the end of your child themes functions file.
  2. Swap out the CPT name from gd_place to the name of your CPT.

Remember to use your CPT slug & re-save permalinks.

Demo

View what the code does before you checkout.

Watch Demo Video

Primary Sidebar

Cart

Code written by Brad Dalton specialist for WooCommerce with more than 10 years of experience.

Advertise · WPEngine · Genesis · Log in

  • Code Snippets
  • Tutorials
  • Videos
  • Account
  • Checkout
  • Cart