Is it possible to set show_on_front and page_on_front via XMLRPC? They do not appear in the list returned from wp.getOptions and using wp.setOptions does not appear to change the values.
1 Answer
These options are not among the default writable $blog_options
.
Here's one (untested) idea using the xmlrpc_blog_options
filter to make the show_on_front
option writeable:
/**
* Add 'show_on_front' to the list of XML-RPC writeable options.
*/
add_filter( 'xmlrpc_blog_options', function( $blog_options )
{
if( is_array( $blog_options ) )
{
$blog_options['show_on_front'] = array(
'desc' => __( 'Show on front' ),
'readonly' => false,
'option' => 'show_on_front'
);
}
return $blog_options;
});
and similar for the page_on_front
option.