WordPress.org

Make WordPress Core

Ticket #5010: save_post_parent_id.diff

File save_post_parent_id.diff, 1.4 KB (added by filosofo, 7 years ago)
  • wp-includes/post.php

     
    12841284 
    12851285        // export array as variables 
    12861286        extract($object, EXTR_SKIP); 
     1287        if ( empty( $post_parent ) && isset( $object['post_parent'] ) && ! empty( $object['post_parent'] ) )  
     1288                $post_parent = $object['post_parent']; 
    12871289 
    12881290        // Make sure we set a valid category 
    12891291        if (0 == count($post_category) || !is_array($post_category)) { 
  • wp-admin/js/upload.js

     
    201201                        h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>"; 
    202202                        h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />"; 
    203203                        h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />"; 
     204                        h += "<input type='hidden' name='post_parent' value='" + parseInt(this.postID,10) + "' />"; 
    204205                        h += "<input type='hidden' name='action' id='action-value' value='save' />"; 
    205206                        h += "<input type='hidden' name='ID' value='" + id + "' />"; 
    206207                        h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";