Title: [Plugin: Easy Custom Fields] Field content disappears when saving
Last modified: August 19, 2016

---

# [Plugin: Easy Custom Fields] Field content disappears when saving

 *  Resolved [theoldswitcheroo](https://wordpress.org/support/users/theoldswitcheroo/)
 * (@theoldswitcheroo)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-easy-custom-fields-field-content-disappears-when-saving/)
 * I tried using the ‘Simple Usage’ code in my functions.php file. I got it to come
   up like I needed at the bottom of my posts and then I entered the information.
 * Once I click update/publish on the post the screen refreshes and says published.
   Then I scroll down and realize that the content I just entered in the fields 
   has disappeared.
 * Can someone please help me figure out why this is?
 * Thanks in advance!
 * [http://wordpress.org/extend/plugins/easy-custom-fields/](http://wordpress.org/extend/plugins/easy-custom-fields/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [sjwilliams](https://wordpress.org/support/users/sjwilliams/)
 * (@sjwilliams)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-easy-custom-fields-field-content-disappears-when-saving/#post-2075614)
 * I also noticed this. I’m running WP 3.2.1 and ECF 0.1.
 * I’ve poked around a bit and it looks like the plugin is failing on this line:
 * `if ( !current_user_can( $post_type_object->edit_cap ) )`
 * From what I can tell, the `$post_type_object`, which is from `get_post_type_object()`,
   doesn’t actually contain edit_cap. The object does contain `$post_type_object-
   >capability_type`, but as admin returns ‘post,’ which isn’t on this list for `
   current_user_can()` ([http://codex.wordpress.org/Roles_and_Capabilities](http://codex.wordpress.org/Roles_and_Capabilities)).
 * In the end, I changed the line to:
    `if ( !current_user_can( $post_type_object-
   >cap->edit_post ) )`
 * There are several user roles under `$post_type_object->cap`. I figured if the
   user is allowed to edit the post, the should be allowed to add custom field data.
 * Everything *seems* to be working now. YMMV.
 *  Plugin Author [Thorsten Ott](https://wordpress.org/support/users/tott/)
 * (@tott)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-easy-custom-fields-field-content-disappears-when-saving/#post-2075618)
 * Thanks for pointing this out. I updated the plugin accordingly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Easy Custom Fields] Field content disappears when saving’ is
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/easy-custom-fields.svg)
 * [Easy Custom Fields](https://wordpress.org/plugins/easy-custom-fields/)
 * [Support Threads](https://wordpress.org/support/plugin/easy-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-custom-fields/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Thorsten Ott](https://wordpress.org/support/users/tott/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-easy-custom-fields-field-content-disappears-when-saving/#post-2075618)
 * Status: resolved