Skip to content

Instantly share code, notes, and snippets.

View ikishorkumar's full-sized avatar
🎯
Focusing on Elasticsearch | Kibana | Logstash | ELK Stack

Kishor Kumar ikishorkumar

🎯
Focusing on Elasticsearch | Kibana | Logstash | ELK Stack
View GitHub Profile
@ikishorkumar
ikishorkumar / pmpro_allow_access_for_admins.php
Created October 24, 2022 13:23 — forked from andrewlimaza/pmpro_allow_access_for_admins.php
Allow admins, administrator, administrators access to all restricted posts in WordPress with Paid Memberships Pro
<?php
/**
* This code snippet allows admins without any PMPro membership level to access any restricted content.
* Add this code to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmmpro_allow_access_for_admins($hasaccess, $mypost, $myuser, $post_membership_levels){
//If user is an admin allow access.
if( current_user_can( 'manage_options' ) ){