Jump to content

block inputs (custom fields)


JesusSuarz

Recommended Posts

I hope someone has knowledge about this ..

I find very little information about it. I hope someone helps me.

I am trying to prevent users from being able to change some fields in their profile.

I found the following function:

https://developers.whmcs.com/hooks-reference/everything-else/#customfieldsave

<?php

add_hook('CustomFieldSave', 1, function($vars) {
    return array('value' => 'overridden value',);
});

this prevents any field from being editable,

however, how can I select a specific field?

img: 

1819963423_chrome-capture(91).jpg.1f0d5695e35fc6f2ba54a84d1f2e0ba0.jpg

someone posted an idea in 2019.

however it doesn't work, because fieldid and relid return NULL from $vars

any idea?

I just need to select the fields that I want to prevent from being edited.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated