Last active
February 22, 2017 07:30
-
-
Save DavidCramer/d3eed24e3ec33ba20e7c2b3c5827a7e1 to your computer and use it in GitHub Desktop.
Exclude administrators from DB Post Types users connection
This file contains 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
<?php | |
// Add the code below to your functions.php file of your child theme. | |
// This removes all users that are administrators from being synced in DB Post Types | |
// Uses the `dbpt_source_exclude-{$slug}` filter | |
add_filter( 'dbpt_source_exclude-users', function () { | |
// return the ID's of users NOT to be synced. | |
return get_users( array( | |
'role__in' => array( 'administrator' ), | |
'fields' => 'ids', | |
) ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment