• I would like users to only be able to edit SOME of the custom fields in their profile in wordpress. The others I would like for only admin users to be able to edit.

    In types, usermeta-post.php is responsible for displaying the user meta information when a user is editing their profile. See this function:
    wpcf_usermeta_preview_profile

    At the top of the file, it says to hook into it, but I can’t find hooks. Are there hooks available here that would allow me to filter the array of fields that are displayed?

    (If there’s another plugin that does this easily, I’m open to trying that also).

    https://www.ads-software.com/plugins/types/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dear dwlorimer

    You must dig deeper, because function which produce HTML is types_render_field_single and in this function you can stop display.

    Remember that you must avoid delete fields (if is not displayed, then is not send, then Types delete it or reset it from user profile).

    But, I recommend you to use one of our paid plugin – Access – Role Management and Access Control for WordPress.

    Cheers,
    Marcin

    Thread Starter dwlorimer

    (@dwlorimer)

    Perhaps I didn’t explain my question well.

    I’m talking about the Admin Edit Profile screen. When a user (who is not an admin user) comes to this page, I would like them to only see some of the additional fields. But when an admin user views the page, I would like them to see them all.

    I do not have the opportunity to use types_render_field in this instance, because all fields are displayed by default.

    I am not aware that the paid plugins you mention have the ability to do this.

    Are you suggesting that wpcf_usermeta_preview_profile() in usermeta-post.php uses the types_render_field to display the information on the Edit Profile screen? If that is the case, can you give me an example of how I would use that to stop the display for non-admin users of a field with the slug of “award”? Or, it’s ok if the user can view, but not edit, the field.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying Some custom fields’ is closed to new replies.