Unblock if custom field "public" exists
-
I am trying to unblock all pages that have custom field “public” but this is not working
add_filter( ‘restricted_site_access_is_restricted’, ‘my_override’ );
function my_override( $is_restricted ) { global $wp; $ispublic= get_post_meta($wp->post->ID, 'public', true); if ( $ispublic) { $is_restricted = false; } return $is_restricted; }
- The topic ‘Unblock if custom field "public" exists’ is closed to new replies.