Opened 8 years ago
Last modified 8 years ago
#40863 reopened defect (bug)
WP 4.7.5 XMLRPC new method for parsing arguments omits menu_order
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.7.5 |
Component: | XML-RPC | Keywords: | |
Focuses: | Cc: |
Description
In WP 4.7.5, in wp-includes/class-wp-xmlrpc-server.php, on line 1327, this line:
$post_data = wp_parse_args( $content_struct, $defaults );
was changed to:
$post_data = wp_parse_args( array_intersect_key( $content_struct, $defaults ), $defaults );
Unfortunately, the new intersection strips out any arguments from $content_struct that don't exist in $defaults.
So you can no longer edit a post and change the "menu_order" field, because it doesn't exist in the $defaults declared just before this line.
Please provide either an updated list of acceptable defaults (e.g. including menu fields), or allow for additional fields to pass through to wp_parse_args.
Tested with latest version of WP, and confirmed that swapping the changed line above enables/disables the ability to change menu_order in posts.
Attachments (1)
Change History (7)
#2
in reply to:
↑ 1
@
8 years ago
Adding menu_order would solve our problem nicely. Not sure my opinion matters, but I agree the other fields aren't necessary. Thanks
Replying to iworks:
Added two params:
- menu_order
- to_ping
We still have to miss (based on wp_insert_post()) those fields:
- pinged
- import_id
- context
- post_content_filtered
But I'm not sure we should add it.
#WCPL2017
#4
follow-up:
↓ 6
@
8 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
I assume closing this ticket wasn't intended. Let's also at least add a basic test for this so this wouldn't happen in the future.
#5
@
8 years ago
My apologies, but I'm not aware of the specific process I need to follow. I conducted a test on a site with the above change, and found that it worked perfectly
#6
in reply to:
↑ 4
@
8 years ago
Replying to markoheijnen:
I assume closing this ticket wasn't intended. Let's also at least add a basic test for this so this wouldn't happen in the future.
I'm sorry, but I'm not clear on the process for implementing this change (re-inserting menu_order back into the class-wp-xmlrpc-server.file). Do you know how I would initiate that process?
Added two params:
We still have to miss (based on wp_insert_post()) those fields:
But I'm not sure we should add it.
#WCPL2017