Home Forums Backend Issues (wp-admin) My Custom Field Deletes Itself… Reply To: My Custom Field Deletes Itself…

  • And if you remove the code then there is not problem?

    what part of it causes the problem? If you comment out the load_field add_filter line does the problem go away?

    To be honest, I’m really not sure by looking at your function why you would call it on the two hooks show_user_profile and edit_user_profile as these hooks are used to output HTML, which you’re not doing.

    You might try looping through the posts of your query without using have_posts, that will eliminate the query being the cause of the problem

    function numediaweb_custom_user_profile_fields($user) {
      $objekt = array();
      $the_query = new WP_Query("post_type=immomakler_object&posts_per_page=-1&field=ids");
      if (count($the_query->posts)) {
        foreach ($this_query->posts as $post) {
          $post_id = $post->ID;
          $objektsave = get_post_meta($post_id,'objektnr_extern',true);
          $objekt[] = $objektsave;
      return $objekt;