Last active
March 29, 2021 02:59
-
-
Save kimcoleman/3c6fbf21ac77e887212bb16d32f20f21 to your computer and use it in GitHub Desktop.
Example SQL to add restriction on CPT 'gallery' for Level ID 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example SQL to add restriction on CPT 'gallery' for Level ID 3. Change CPT name and ID for your needs. | |
INSERT IGNORE INTO wp_pmpro_memberships_pages (membership_id, page_id) | |
SELECT '3', ID FROM wp_posts WHERE post_type = 'gallery'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Bulk methods to restrict access to posts, pages, and CPTs for a specific membership level ID via MySQL" at Paid Memberships Pro here: https://www.paidmembershipspro.com/bulk-methods-to-restrict-access-to-posts-pages-and-cpts-for-a-specific-membership-level-id-via-mysql/