Opened 9 years ago
Last modified 9 years ago
#40863 reopened defect (bug)
WP 4.7.5 XMLRPC new method for parsing arguments omits menu_order
| Reported by: | bjminihan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | XML-RPC | Version: | 4.7.5 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
9 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
@
9 years ago
- Resolution worksforme
- Status closed → 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
@
9 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
@
9 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?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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