WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 17 months ago

Last modified 17 months ago

#5461 closed enhancement (maybelater)

Add ability to set description for XML-RPC file uploads

Reported by: josephscott Owned by:
Milestone: Priority: low
Severity: normal Version: 2.3.1
Component: XML-RPC Keywords:
Focuses: Cc:

Description

It's been suggested that we provide a way to populate the description field for file uploads. This is something that we could add to the wp.uploadFile method.

Change History (4)

comment:1 @Denis-de-Bernardy6 years ago

  • Milestone changed from 2.9 to Future Release

comment:2 @chriscct717 months ago

  • Keywords 2nd-opinion dev-feedback added; needs-patch removed
  • Type changed from enhancement to feature request

Hi Joseph,
Thanks for the great idea, and sorry it took so long to get you a response. The original file function you referenced no longer exists, and instead now aliases to wp:mw_newMediaObject.

In the current release, to add the description, what you could do is just have a plugin that hooks into xmlrpc_call_success_mw_newMediaObject and use the $id and $args parameters to set the description:

function 5461_example( $id, $args ){
    // validate the $args['description'] parameter
    // use update_post_meta, where $id is the post_id of the attachment to save $args['description'] as the description

}
add_action( 'xmlrpc_call_success_mw_newMediaObject', '5461_example', 10 , 2);

Basically, in your XMLRPC call to wp:mw_newMediaObject, add a parameter for the description in your $args array and then use a plugin that hooks into the wp:mw_newMediaObject action after uploading the attachment to save that description into the description of the attachment post.

comment:3 @nacin17 months ago

  • Keywords 2nd-opinion dev-feedback removed
  • Milestone Future Release deleted
  • Priority changed from normal to low
  • Resolution set to maybelater
  • Status changed from new to closed
  • Type changed from feature request to enhancement

chriscct7, josephscott is one of the XML-RPC maintainers. :-)

I'm going to close this out. Easy enough to re-open if we still wanted it.

comment:4 @ircbot17 months ago

This ticket was mentioned in IRC in #wordpress-dev by chriscct7. View the logs.

Note: See TracTickets for help on using tickets.