[wp-trac] [WordPress Trac] #14192: Quick Edit On Custom Post Type Removes Custom Meta Values

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 4 07:12:21 UTC 2010


#14192: Quick Edit On Custom Post Type Removes Custom Meta Values
----------------------------+-----------------------------------------------
 Reporter:  liamgooding     |        Owner:         
     Type:  defect (bug)    |       Status:  closed 
 Priority:  normal          |    Milestone:         
Component:  Administration  |      Version:  3.0    
 Severity:  normal          |   Resolution:  invalid
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by dd32):

  * keywords:  custom post type =>
  * status:  reopened => closed
  * resolution:  => invalid
  * milestone:  Awaiting Review =>


Comment:

 Checking to see if the constant is set is not a good idea either, The
 actions might be fired by something else edditing the post.

 Instead, you should be outputting a nonce to your custom form, and
 checking that in your handler

 ie.
 {{{
 function myplugin_handle_save() {
  if ( !isset($_POST['mynonce']) || !wp_check_nonce('somenonce',
 $_POST['mynonce']) )
    return;
   update_post_meta(.....)
 }
 }}}
 (Note: That code is completely wrong, i'm not sure of the nonce checking
 function off the top of my head, you'd have to look it up, there are many
 cases of this mentioned in regards to custom post types.)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14192#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list