Limit post view and management to custom user meta information
You have to filter user_has_cap and compare the user meta fields. The following code is based on this answer and not tested. add_filter( ‘user_has_cap’, ‘wpse_99393_filter_cap’, 10, 3 ); /** * Allow editing others posts only for editors from the same school. * Administrators can still edit those posts. * * @wp-hook user_has_cap * @param array … Read more