Advertisement
fauzanjeg

Fix Upload Avatar

Nov 28th, 2021
1,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. /* Fix Upload Avatar */
  2. function fix_upload_avatar( $allcaps, $caps, $args, $class ) {
  3.     if ( strpos( $_SERVER['HTTP_REFERER'], 'edit-account' ) ) {
  4.         $allcaps['upload_files'] = true;
  5.     }
  6.     return $allcaps;
  7. }
  8. add_filter( 'user_has_cap', 'fix_upload_avatar', null, 4 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement