@@ -5143,7 +5143,15 @@ public function blogger_newPost( $args ) {
5143
5143
$ post_date = current_time ( 'mysql ' );
5144
5144
$ post_date_gmt = current_time ( 'mysql ' , 1 );
5145
5145
5146
- $ post_data = compact ( 'post_author ' , 'post_date ' , 'post_date_gmt ' , 'post_content ' , 'post_title ' , 'post_category ' , 'post_status ' );
5146
+ $ post_data = compact (
5147
+ 'post_author ' ,
5148
+ 'post_date ' ,
5149
+ 'post_date_gmt ' ,
5150
+ 'post_content ' ,
5151
+ 'post_title ' ,
5152
+ 'post_category ' ,
5153
+ 'post_status '
5154
+ );
5147
5155
5148
5156
$ post_id = wp_insert_post ( $ post_data );
5149
5157
if ( is_wp_error ( $ post_id ) ) {
@@ -5595,7 +5603,26 @@ public function mw_newPost( $args ) {
5595
5603
}
5596
5604
}
5597
5605
5598
- $ postdata = compact ( 'post_author ' , 'post_date ' , 'post_date_gmt ' , 'post_content ' , 'post_title ' , 'post_category ' , 'post_status ' , 'post_excerpt ' , 'comment_status ' , 'ping_status ' , 'to_ping ' , 'post_type ' , 'post_name ' , 'post_password ' , 'post_parent ' , 'menu_order ' , 'tags_input ' , 'page_template ' );
5606
+ $ postdata = compact (
5607
+ 'post_author ' ,
5608
+ 'post_date ' ,
5609
+ 'post_date_gmt ' ,
5610
+ 'post_content ' ,
5611
+ 'post_title ' ,
5612
+ 'post_category ' ,
5613
+ 'post_status ' ,
5614
+ 'post_excerpt ' ,
5615
+ 'comment_status ' ,
5616
+ 'ping_status ' ,
5617
+ 'to_ping ' ,
5618
+ 'post_type ' ,
5619
+ 'post_name ' ,
5620
+ 'post_password ' ,
5621
+ 'post_parent ' ,
5622
+ 'menu_order ' ,
5623
+ 'tags_input ' ,
5624
+ 'page_template '
5625
+ );
5599
5626
5600
5627
$ post_id = get_default_post_to_edit ( $ post_type , true )->ID ;
5601
5628
$ postdata ['ID ' ] = $ post_id ;
@@ -5777,7 +5804,7 @@ public function mw_editPost( $args ) {
5777
5804
5778
5805
$ this ->escape ( $ postdata );
5779
5806
5780
- $ ID = $ postdata ['ID ' ];
5807
+ $ post_id = $ postdata ['ID ' ];
5781
5808
$ post_content = $ postdata ['post_content ' ];
5782
5809
$ post_title = $ postdata ['post_title ' ];
5783
5810
$ post_excerpt = $ postdata ['post_excerpt ' ];
@@ -5979,7 +6006,27 @@ public function mw_editPost( $args ) {
5979
6006
}
5980
6007
5981
6008
// We've got all the data -- post it.
5982
- $ newpost = compact ( 'ID ' , 'post_content ' , 'post_title ' , 'post_category ' , 'post_status ' , 'post_excerpt ' , 'comment_status ' , 'ping_status ' , 'edit_date ' , 'post_date ' , 'post_date_gmt ' , 'to_ping ' , 'post_name ' , 'post_password ' , 'post_parent ' , 'menu_order ' , 'post_author ' , 'tags_input ' , 'page_template ' );
6009
+ $ newpost = compact (
6010
+ 'post_id ' ,
6011
+ 'post_content ' ,
6012
+ 'post_title ' ,
6013
+ 'post_category ' ,
6014
+ 'post_status ' ,
6015
+ 'post_excerpt ' ,
6016
+ 'comment_status ' ,
6017
+ 'ping_status ' ,
6018
+ 'edit_date ' ,
6019
+ 'post_date ' ,
6020
+ 'post_date_gmt ' ,
6021
+ 'to_ping ' ,
6022
+ 'post_name ' ,
6023
+ 'post_password ' ,
6024
+ 'post_parent ' ,
6025
+ 'menu_order ' ,
6026
+ 'post_author ' ,
6027
+ 'tags_input ' ,
6028
+ 'page_template '
6029
+ );
5983
6030
5984
6031
$ result = wp_update_post ( $ newpost , true );
5985
6032
if ( is_wp_error ( $ result ) ) {
@@ -6022,7 +6069,7 @@ public function mw_editPost( $args ) {
6022
6069
$ enclosure = isset ( $ content_struct ['enclosure ' ] ) ? $ content_struct ['enclosure ' ] : null ;
6023
6070
$ this ->add_enclosure_if_new ( $ post_id , $ enclosure );
6024
6071
6025
- $ this ->attach_uploads ( $ ID , $ post_content );
6072
+ $ this ->attach_uploads ( $ post_id , $ post_content );
6026
6073
6027
6074
// Handle post formats if assigned, validation is handled earlier in this function.
6028
6075
if ( isset ( $ content_struct ['wp_post_format ' ] ) ) {
@@ -6458,20 +6505,20 @@ public function mw_newMediaObject( $args ) {
6458
6505
);
6459
6506
6460
6507
// Save the data.
6461
- $ id = wp_insert_attachment ( $ attachment , $ upload ['file ' ], $ post_id );
6462
- wp_update_attachment_metadata ( $ id , wp_generate_attachment_metadata ( $ id , $ upload ['file ' ] ) );
6508
+ $ attachment_id = wp_insert_attachment ( $ attachment , $ upload ['file ' ], $ post_id );
6509
+ wp_update_attachment_metadata ( $ attachment_id , wp_generate_attachment_metadata ( $ attachment_id , $ upload ['file ' ] ) );
6463
6510
6464
6511
/**
6465
6512
* Fires after a new attachment has been added via the XML-RPC MovableType API.
6466
6513
*
6467
6514
* @since 3.4.0
6468
6515
*
6469
- * @param int $id ID of the new attachment.
6470
- * @param array $args An array of arguments to add the attachment.
6516
+ * @param int $attachment_id ID of the new attachment.
6517
+ * @param array $args An array of arguments to add the attachment.
6471
6518
*/
6472
- do_action ( 'xmlrpc_call_success_mw_newMediaObject ' , $ id , $ args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
6519
+ do_action ( 'xmlrpc_call_success_mw_newMediaObject ' , $ attachment_id , $ args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
6473
6520
6474
- $ struct = $ this ->_prepare_media_item ( get_post ( $ id ) );
6521
+ $ struct = $ this ->_prepare_media_item ( get_post ( $ attachment_id ) );
6475
6522
6476
6523
// Deprecated values.
6477
6524
$ struct ['id ' ] = $ struct ['attachment_id ' ];
0 commit comments