WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15153 closed enhancement (fixed)

Add Media Settings calls to XML-RPC

Reported by: frsh Owned by: westi
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: XML-RPC Keywords: media settings, xml-rpc
Focuses: Cc:

Description

Proposal: Add functionality to allow a caller to read and update a user's preferences in Media Settings.

wp.getMediaSettings
This call would return settings available in the Media Settings area of wp-admin. For example: If a user has specified properties for Image Sizes such as Thumbnail Size, Medium Size, and Large Size, this call would return those properties.

wp.setMediaSettings
This call would allow a caller to save settings available in the Media Settings area of wp-admin. For example: A user changes their preference for Image resizing inside of a mobile app, and the setting is updated in their Media Settings area as well.

Attachments (2)

patch-15153-1.diff (2.8 KB) - added by koke 3 years ago.
First patch proposal
patch-15153-2.diff (1.4 KB) - added by koke 3 years ago.
Patch using getOption/setOption instead of custom methods

Download all attachments as: .zip

Change History (13)

comment:1 westi3 years ago

  • Owner set to westi
  • Status changed from new to accepted

comment:2 mtdewvirus3 years ago

  • Cc mtdewvirus@… added

comment:3 koke3 years ago

  • Cc koke added

comment:4 westi3 years ago

I think it might be better to extend the list of options that can be set/read using wp.getOptions / wp.setOptions

comment:5 josephscott3 years ago

  • Cc josephscott added

I second westi's suggestion, this should make use of the existing options methods instead of adding new methods.

koke3 years ago

First patch proposal

comment:6 koke3 years ago

Right now the proposed patch returns the settings as a list of related options:

  <member><name>thumbnail_size_w</name><value><int>96</int></value></member>
  <member><name>thumbnail_size_h</name><value><int>96</int></value></member>
  <member><name>thumbnail_crop</name><value><string>1</string></value></member>
  <member><name>medium_size_w</name><value><string>360</string></value></member>
  <member><name>medium_size_h</name><value><string>360</string></value></member>
  <member><name>large_size_w</name><value><string>900</string></value></member>
  <member><name>large_size_h</name><value><string>900</string></value></member>

Is that OK, or should options be grouped?

  • thumbnail
    • width
    • height
    • crop
  • medium
    • width
    • height
  • large
    • width
    • height

koke3 years ago

Patch using getOption/setOption instead of custom methods

comment:7 westi3 years ago

patch-15153-2.doff looks great.

Thank You!

comment:8 frsh3 years ago

These are looking good on my 3.0.1 install.

comment:9 frsh3 years ago

  • Cc frsh added

comment:10 westi3 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:11 westi3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in [15980] props koke :-)

Note: See TracTickets for help on using tickets.