Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#25264 closed feature request (invalid)

The "do_action"s in class-wp-xmlrpc-server.php do not pass in useable arguments.

Reported by: jtsternberg's profile jtsternberg Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: XML-RPC Keywords: dev-feedback
Focuses: Cc:

Description

It seems it should be possible to use hooks like do_action( 'xmlrpc_call', 'wp.newPost' ); to manipulate xmlrpc-inserted posts, terms, etc.

These would be infinitely more useable.
do_action( 'xmlrpc_call', 'wp.newPost', $user, $content_struct );
do_action( 'xmlrpc_call', 'wp.editPost', $blog_id, $user, $post_id, $content_struct );
do_action( 'xmlrpc_call', 'wp.newTerm', $user, $content_struct );

Change History (4)

#1 @SergeyBiryukov
11 years ago

  • Component changed from General to XML-RPC

#2 follow-up: @maxcutler
11 years ago

XML-RPC uses wp_insert_post internally, so you can use the usual 'save_post' action to do work after it has been saved.

Or if you want to manipulate it before it is saved, look at the 'xmlrpc_prepare_post' filter.

#3 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The only purpose of the xmlrpc_call actions is to announce that a method is being used. As maxcutler says, there are other ways.

#4 in reply to: ↑ 2 @Viruthagiri
9 years ago

Replying to maxcutler:

XML-RPC uses wp_insert_post internally, so you can use the usual 'save_post' action to do work after it has been saved.

Or if you want to manipulate it before it is saved, look at the 'xmlrpc_prepare_post' filter.

'wp_insert_post' hooks are not useful here. Because XML-RPC uses 'get_default_post_to_edit' first.

Note: See TracTickets for help on using tickets.