Home › Forums › General Issues › Get_fields error of deleted users in repeater
I have a custom post type of events.
With a bunch of ACF fields on the custom post type. One of these fields is a repeater with event-administrators(users with a spesific role)
However if i delete one of the users that is registred as a event-administrator in wordpress core users. Then when i run get_fields($post->ID) it prints the following notice:
<b>Notice</b>: Trying to get property 'user_firstname' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>567</b>
<b>Notice</b>: Trying to get property 'user_lastname' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>568</b>
<b>Notice</b>: Trying to get property 'nickname' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>569</b>
<b>Notice</b>: Trying to get property 'user_nicename' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>570</b>
<b>Notice</b>: Trying to get property 'display_name' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>571</b>
<b>Notice</b>: Trying to get property 'user_email' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>572</b>
<b>Notice</b>: Trying to get property 'user_url' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>573</b>
<b>Notice</b>: Trying to get property 'user_registered' of non-object in <b>r\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>574</b>
<b>Notice</b>: Trying to get property 'user_description' of non-object in <b>\wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-user.php</b> on line <b>575</b>
Any ideas how to remove the event-administrators rows from all events if the user is deleted or remove the notice (not remove by just set debug to false)?
You must be logged in to reply to this topic.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw
— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.