Home › Forums › ACF PRO › Cheate field visible but not editable › Reply To: Cheate field visible but not editable
Running on a MAMP server – Local.
I have tried this code using the key for the field I want to control but, with only changing the key and then logging in with a user not an admin, when I try to edit the record it casts and error. Admin has no issues.
My field is a number and called “Stock id”
Field name: vehicle_stock_id
Key: field_5f115aa7bf4ef
Fatal error: Uncaught Error: Call to undefined function is_user_logged_id() in /private/var/tmp/8-read-only-stock-id.php:10 Stack trace: #0 /Users/john/Sites/wp-agent-kaz-20/wp-includes/class-wp-hook.php(307): edit_admin_only(Array) #1 /Users/john/Sites/wp-agent-kaz-20/wp-includes/plugin.php(233): WP_Hook->apply_filters(Array, Array) #2 /Users/john/Sites/wp-agent-kaz-20/wp-content/plugins/advanced-custom-fields-pro/includes/acf-hook-functions.php(109): apply_filters_ref_array(‘acf/prepare_fie…’, Array) #3 /Users/john/Sites/wp-agent-kaz-20/wp-includes/class-wp-hook.php(307): _acf_apply_hook_variations(Array) #4 /Users/john/Sites/wp-agent-kaz-20/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array) #5 /Users/john/Sites/wp-agent-kaz-20/wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php(556): apply_filters(‘acf/prepare_fie…’, Array) #6 /Users/john/Sites/wp-agent-kaz-20/wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php(648): acf_prepare_field(Array) #7 /U in /private/var/tmp/8-read-only-stock-id.php on line 10
Log back in as admin user, no issues but the record remains “locked” and I have to take over.
Wordpress version 5.9
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.