0

I am looking to make it so a subscriber can login and view their profile but not change any of their settings. Only the admin can change the profile settings. Again, I am not looking to hide the profile completely, just to make it un-editable by the subscriber who's profile it is.

1
  • I am using the WP-Members plugin and have hacked a solution for the profile view on the front end of the website. This leaves the 'Update Now" button but renders the input fields un-editable. Commented May 9, 2016 at 12:33

1 Answer 1

0
add_filter( 'wpmem_register_form_rows', 'prefix_profile', 9999, 2 );
function prefix_profile( $rows, $toggle ){
    if( 'edit' == $toggle ){
          foreach( $rows as $row_item ){
               $rows[$row_item['meta']]['field'] = preg_replace( '/<input(.*) value="(.*)" class="textbox"(.*)\/>/', '<p class="noinput">$2&nbsp;</p>', $row_item['field'] );
               $rows[$row_item['meta']]['label'] = str_replace( '*', '', $row_item['label'] );
          }
    }
    return $rows;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.