• Resolved Etienne

    (@epipo)


    Hello,

    I am trying to check if a user has defined an avatar so that I can display a notification if it’s not the case.

    However, when I check if get_user_meta( get_current_user_id(), 'user_cover', true ) is empty it always returns true. If I check with get_avatar I can’t see if it’s the default avatar or a user defined avatar.

    Any idea?
    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Alessandro Tesoro

    (@alessandrotesoro)

    Hi there,

    If you’d like to check that the user has uploaded a custom avatar through WPUM, you can check the user meta through this:

    carbon_get_user_meta( $user_id, 'current_user_avatar' );

    carbon_get_user_meta is a function that comes with the custom fields framework embedded into the plugin called carbon fields https://carbonfields.net/

    Thread Starter Etienne

    (@epipo)

    Hi Alessandro,

    Sorry for the delay, this is perfect.

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Check if user_cover is defined’ is closed to new replies.