[wp-trac] [WordPress Trac] #7123: New wp.getOptions and
wp.setOptions XML-RPC methods
WordPress Trac
wp-trac at lists.automattic.com
Wed Jun 11 17:12:56 GMT 2008
#7123: New wp.getOptions and wp.setOptions XML-RPC methods
-------------------------+--------------------------------------------------
Reporter: josephscott | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.6
Component: XML-RPC | Version: 2.5.1
Severity: normal | Keywords: has-patch
-------------------------+--------------------------------------------------
There are a number of options (and information variables) in WordPress
that would helpful to blog clients. Some of these are strictly
informational and therefore read-only, while others could be changed.
I've added two new XML-RPC methods: wp.getOptions and wp.setOptions, along
with a list of options that are to be exposed. To start with the list is
fairly small, but it's very easy to add more.
The option list looks like this:
{{{
{
'option_name': {
'desc': 'Label Description Here',
'readonly': true,
'value': 123
}
}
}}}
The readonly field will be either true or false, the desc field will
always be a string. The value field might be a little tricky, some values
will be numeric, others will be strings. Check out the patch for the
current list of options, it's pretty clear.
The wp.getOptions method looks like:
{{{
wp.getOptions( blog_id, username, password, array )
}}}
The last parameter, array, is optional. If it is not included then it
will return all of the option info that we have. With a populated array,
each field is an option name and only those options asked for will be
returned.
The wp.setOptions method looks like:
{{{
wp.setOptions( blog_id, username, password, struct )
}}}
That last struct parameter is option name/value pairs. The return value
is same as if you called wp.getOptions asking for the those option names,
only they'll include the new value. If you try to set a new value for an
option that is read-only, it will silently fail and you'll get the
original value back instead of the new value you attempted to set.
This addresses the issue of exposing the time zone info as requested in
ticket #5659.
--
Ticket URL: <http://trac.wordpress.org/ticket/7123>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list