• Resolved beckyv2

    (@beckyv2)


    Hi there

    I have Ultimate Member installed – we need our members to be able to edit their full profiles, but NOT the cover photo that we have set up. Is there a way to do this? So far, I can only find that I can set the whole profile to be editable, and then disable certain fields in the profile form, but I can’t find an option to disable editing of the cover photo.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • SuitePlugins

    (@suiteplugins)

    If you are able to add code to your site. This might be helpful


    add_filter( 'um_user_photo_menu_edit', '_return_false', 10 );
    missveronica

    (@missveronicatv)

    @beckyv2

    Don’t try the “solution” above, it will not solve anything but give you a PHP failure.

    Try this code snippet, which will both remove the JavaScript
    used for uploading the Cover photo and remove the Camera overlay in Edit mode.

    add_action( 'um_profile_header_cover_area', 'um_profile_header_cover_exclude', 10 );
    
    function um_profile_header_cover_exclude() {
    
        $html = str_replace( array( 'class="um-dropdown"', 'class="um-cover-overlay"' ), 'style="display: none;"', ob_get_clean() );
    
        ob_start();
        echo $html;
    }
    
    add_filter( 'um_cover_area_content_dropdown_items', 'um_cover_area_content_dropdown_no_items', 10, 2 );
    
    function um_cover_area_content_dropdown_no_items( $items, $user_id ) {
    
        return array();
    }

    Install by adding the code snippet to your active theme’s functions.php file
    or use the “Code Snippets” Plugin

    https://www.ads-software.com/plugins/code-snippets/

    SuitePlugins

    (@suiteplugins)

    Thanks for the update missveronicatv

    You are right. Outside of missing an underscore in the callback. I now see the goal was to disable the cover photo and not the profile picture. Oops.

    Thread Starter beckyv2

    (@beckyv2)

    @missveronicatv Thank you! That worked perfectly ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disabling cover photo from being edited’ is closed to new replies.