We indent with tabs, but align with spaces.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
31223d73ed
commit
73938cd0a9
|
@ -114,7 +114,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
'demo.addTwoNumbers' => 'this:addTwoNumbers'
|
'demo.addTwoNumbers' => 'this:addTwoNumbers'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->initialise_blog_option_info( );
|
$this->initialise_blog_option_info();
|
||||||
$this->methods = apply_filters('xmlrpc_methods', $this->methods);
|
$this->methods = apply_filters('xmlrpc_methods', $this->methods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,40 +290,40 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
*
|
*
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
*/
|
*/
|
||||||
function initialise_blog_option_info( ) {
|
function initialise_blog_option_info() {
|
||||||
global $wp_version;
|
global $wp_version;
|
||||||
|
|
||||||
$this->blog_options = array(
|
$this->blog_options = array(
|
||||||
// Read only options
|
// Read only options
|
||||||
'software_name' => array(
|
'software_name' => array(
|
||||||
'desc' => __( 'Software Name' ),
|
'desc' => __( 'Software Name' ),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'value' => 'WordPress'
|
'value' => 'WordPress'
|
||||||
),
|
),
|
||||||
'software_version' => array(
|
'software_version' => array(
|
||||||
'desc' => __( 'Software Version' ),
|
'desc' => __( 'Software Version' ),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'value' => $wp_version
|
'value' => $wp_version
|
||||||
),
|
),
|
||||||
'blog_url' => array(
|
'blog_url' => array(
|
||||||
'desc' => __( 'Site URL' ),
|
'desc' => __( 'Site URL' ),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'option' => 'siteurl'
|
'option' => 'siteurl'
|
||||||
),
|
),
|
||||||
'image_default_link_type' => array(
|
'image_default_link_type' => array(
|
||||||
'desc' => __( 'Image default link type' ),
|
'desc' => __( 'Image default link type' ),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'option' => 'image_default_link_type'
|
'option' => 'image_default_link_type'
|
||||||
),
|
),
|
||||||
'image_default_size' => array(
|
'image_default_size' => array(
|
||||||
'desc' => __( 'Image default size' ),
|
'desc' => __( 'Image default size' ),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'option' => 'image_default_size'
|
'option' => 'image_default_size'
|
||||||
),
|
),
|
||||||
'image_default_align' => array(
|
'image_default_align' => array(
|
||||||
'desc' => __( 'Image default align' ),
|
'desc' => __( 'Image default align' ),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'option' => 'image_default_align'
|
'option' => 'image_default_align'
|
||||||
),
|
),
|
||||||
'template' => array(
|
'template' => array(
|
||||||
'desc' => __( 'Template' ),
|
'desc' => __( 'Template' ),
|
||||||
|
@ -337,80 +337,80 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
),
|
),
|
||||||
|
|
||||||
// Updatable options
|
// Updatable options
|
||||||
'time_zone' => array(
|
'time_zone' => array(
|
||||||
'desc' => __( 'Time Zone' ),
|
'desc' => __( 'Time Zone' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'gmt_offset'
|
'option' => 'gmt_offset'
|
||||||
),
|
),
|
||||||
'blog_title' => array(
|
'blog_title' => array(
|
||||||
'desc' => __( 'Site Title' ),
|
'desc' => __( 'Site Title' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'blogname'
|
'option' => 'blogname'
|
||||||
),
|
),
|
||||||
'blog_tagline' => array(
|
'blog_tagline' => array(
|
||||||
'desc' => __( 'Site Tagline' ),
|
'desc' => __( 'Site Tagline' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'blogdescription'
|
'option' => 'blogdescription'
|
||||||
),
|
),
|
||||||
'date_format' => array(
|
'date_format' => array(
|
||||||
'desc' => __( 'Date Format' ),
|
'desc' => __( 'Date Format' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'date_format'
|
'option' => 'date_format'
|
||||||
),
|
),
|
||||||
'time_format' => array(
|
'time_format' => array(
|
||||||
'desc' => __( 'Time Format' ),
|
'desc' => __( 'Time Format' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'time_format'
|
'option' => 'time_format'
|
||||||
),
|
),
|
||||||
'users_can_register' => array(
|
'users_can_register' => array(
|
||||||
'desc' => __( 'Allow new users to sign up' ),
|
'desc' => __( 'Allow new users to sign up' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'users_can_register'
|
'option' => 'users_can_register'
|
||||||
),
|
),
|
||||||
'thumbnail_size_w' => array(
|
'thumbnail_size_w' => array(
|
||||||
'desc' => __( 'Thumbnail Width' ),
|
'desc' => __( 'Thumbnail Width' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'thumbnail_size_w'
|
'option' => 'thumbnail_size_w'
|
||||||
),
|
),
|
||||||
'thumbnail_size_h' => array(
|
'thumbnail_size_h' => array(
|
||||||
'desc' => __( 'Thumbnail Height' ),
|
'desc' => __( 'Thumbnail Height' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'thumbnail_size_h'
|
'option' => 'thumbnail_size_h'
|
||||||
),
|
),
|
||||||
'thumbnail_crop' => array(
|
'thumbnail_crop' => array(
|
||||||
'desc' => __( 'Crop thumbnail to exact dimensions' ),
|
'desc' => __( 'Crop thumbnail to exact dimensions' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'thumbnail_crop'
|
'option' => 'thumbnail_crop'
|
||||||
),
|
),
|
||||||
'medium_size_w' => array(
|
'medium_size_w' => array(
|
||||||
'desc' => __( 'Medium size image width' ),
|
'desc' => __( 'Medium size image width' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'medium_size_w'
|
'option' => 'medium_size_w'
|
||||||
),
|
),
|
||||||
'medium_size_h' => array(
|
'medium_size_h' => array(
|
||||||
'desc' => __( 'Medium size image height' ),
|
'desc' => __( 'Medium size image height' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'medium_size_h'
|
'option' => 'medium_size_h'
|
||||||
),
|
),
|
||||||
'large_size_w' => array(
|
'large_size_w' => array(
|
||||||
'desc' => __( 'Large size image width' ),
|
'desc' => __( 'Large size image width' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'large_size_w'
|
'option' => 'large_size_w'
|
||||||
),
|
),
|
||||||
'large_size_h' => array(
|
'large_size_h' => array(
|
||||||
'desc' => __( 'Large size image height' ),
|
'desc' => __( 'Large size image height' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'large_size_h'
|
'option' => 'large_size_h'
|
||||||
),
|
),
|
||||||
'default_comment_status' => array(
|
'default_comment_status' => array(
|
||||||
'desc' => __( 'Allow people to post comments on new articles' ),
|
'desc' => __( 'Allow people to post comments on new articles' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'default_comment_status'
|
'option' => 'default_comment_status'
|
||||||
),
|
),
|
||||||
'default_ping_status' => array(
|
'default_ping_status' => array(
|
||||||
'desc' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks)' ),
|
'desc' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks)' ),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'option' => 'default_ping_status'
|
'option' => 'default_ping_status'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -451,7 +451,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
do_action( 'xmlrpc_call', 'wp.getUsersBlogs' );
|
do_action( 'xmlrpc_call', 'wp.getUsersBlogs' );
|
||||||
|
|
||||||
$blogs = (array) get_blogs_of_user( $user->ID );
|
$blogs = (array) get_blogs_of_user( $user->ID );
|
||||||
$struct = array( );
|
$struct = array();
|
||||||
|
|
||||||
foreach ( $blogs as $blog ) {
|
foreach ( $blogs as $blog ) {
|
||||||
// Don't include blogs that aren't hosted at this site
|
// Don't include blogs that aren't hosted at this site
|
||||||
|
@ -470,7 +470,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
'xmlrpc' => site_url( 'xmlrpc.php' )
|
'xmlrpc' => site_url( 'xmlrpc.php' )
|
||||||
);
|
);
|
||||||
|
|
||||||
restore_current_blog( );
|
restore_current_blog();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $struct;
|
return $struct;
|
||||||
|
@ -1095,7 +1095,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
$posts_list = wp_get_recent_posts( $query );
|
$posts_list = wp_get_recent_posts( $query );
|
||||||
|
|
||||||
if ( ! $posts_list )
|
if ( ! $posts_list )
|
||||||
return array( );
|
return array();
|
||||||
|
|
||||||
// holds all the posts data
|
// holds all the posts data
|
||||||
$struct = array();
|
$struct = array();
|
||||||
|
@ -1499,7 +1499,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
do_action( 'xmlrpc_call', 'wp.getKeywords' );
|
do_action( 'xmlrpc_call', 'wp.getKeywords' );
|
||||||
|
|
||||||
$tags = array( );
|
$tags = array();
|
||||||
|
|
||||||
if ( $all_tags = get_tags() ) {
|
if ( $all_tags = get_tags() ) {
|
||||||
foreach( (array) $all_tags as $tag ) {
|
foreach( (array) $all_tags as $tag ) {
|
||||||
|
@ -2009,7 +2009,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.getCommentStatusList');
|
do_action('xmlrpc_call', 'wp.getCommentStatusList');
|
||||||
|
|
||||||
return get_comment_statuses( );
|
return get_comment_statuses();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2068,7 +2068,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.getPostStatusList');
|
do_action('xmlrpc_call', 'wp.getPostStatusList');
|
||||||
|
|
||||||
return get_post_statuses( );
|
return get_post_statuses();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2094,7 +2094,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.getPageStatusList');
|
do_action('xmlrpc_call', 'wp.getPageStatusList');
|
||||||
|
|
||||||
return get_page_statuses( );
|
return get_page_statuses();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2118,7 +2118,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
if ( !current_user_can( 'edit_pages' ) )
|
if ( !current_user_can( 'edit_pages' ) )
|
||||||
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
|
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
|
||||||
|
|
||||||
$templates = get_page_templates( );
|
$templates = get_page_templates();
|
||||||
$templates['Default'] = 'default';
|
$templates['Default'] = 'default';
|
||||||
|
|
||||||
return $templates;
|
return $templates;
|
||||||
|
@ -2159,7 +2159,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function _getOptions($options) {
|
function _getOptions($options) {
|
||||||
$data = array( );
|
$data = array();
|
||||||
foreach ( $options as $option ) {
|
foreach ( $options as $option ) {
|
||||||
if ( array_key_exists( $option, $this->blog_options ) ) {
|
if ( array_key_exists( $option, $this->blog_options ) ) {
|
||||||
$data[$option] = $this->blog_options[$option];
|
$data[$option] = $this->blog_options[$option];
|
||||||
|
@ -3542,7 +3542,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
$posts_list = wp_get_recent_posts( $query );
|
$posts_list = wp_get_recent_posts( $query );
|
||||||
|
|
||||||
if ( !$posts_list )
|
if ( !$posts_list )
|
||||||
return array( );
|
return array();
|
||||||
|
|
||||||
foreach ($posts_list as $entry) {
|
foreach ($posts_list as $entry) {
|
||||||
if ( !current_user_can( 'edit_post', $entry['ID'] ) )
|
if ( !current_user_can( 'edit_post', $entry['ID'] ) )
|
||||||
|
|
Loading…
Reference in New Issue