Last active
April 7, 2022 21:15
-
-
Save ronalfy/a229b74462e31ff78f4f80c1eec213b8 to your computer and use it in GitHub Desktop.
Allow Subscribers in User Profile Picture and Gutenberg
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
<?php | |
// For User Profile Picture | |
add_filter( 'mpp_gutenberg_user_role', function( $role ) { | |
return 'subscribers'; | |
} ); | |
// For Gutenberg | |
add_filter( 'rest_user_query', function( $args, $r ) { | |
if( isset( $args['who'] ) && 'authors' == $args['who'] ) { | |
$args['who'] = 'subscribers'; | |
} | |
return $args; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment