Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: class-wp-xmlrpc-server.php
}
[4000] Fix | Delete
}
[4001] Fix | Delete
[4002] Fix | Delete
$comment['comment_parent'] = isset( $content_struct['comment_parent'] ) ? absint( $content_struct['comment_parent'] ) : 0;
[4003] Fix | Delete
[4004] Fix | Delete
/** This filter is documented in wp-includes/comment.php */
[4005] Fix | Delete
$allow_empty = apply_filters( 'allow_empty_comment', false, $comment );
[4006] Fix | Delete
[4007] Fix | Delete
if ( ! $allow_empty && '' === $comment['comment_content'] ) {
[4008] Fix | Delete
return new IXR_Error( 403, __( 'Comment is required.' ) );
[4009] Fix | Delete
}
[4010] Fix | Delete
[4011] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4012] Fix | Delete
do_action( 'xmlrpc_call', 'wp.newComment', $args, $this );
[4013] Fix | Delete
[4014] Fix | Delete
$comment_id = wp_new_comment( $comment, true );
[4015] Fix | Delete
if ( is_wp_error( $comment_id ) ) {
[4016] Fix | Delete
return new IXR_Error( 403, $comment_id->get_error_message() );
[4017] Fix | Delete
}
[4018] Fix | Delete
[4019] Fix | Delete
if ( ! $comment_id ) {
[4020] Fix | Delete
return new IXR_Error( 403, __( 'Something went wrong.' ) );
[4021] Fix | Delete
}
[4022] Fix | Delete
[4023] Fix | Delete
/**
[4024] Fix | Delete
* Fires after a new comment has been successfully created via XML-RPC.
[4025] Fix | Delete
*
[4026] Fix | Delete
* @since 3.4.0
[4027] Fix | Delete
*
[4028] Fix | Delete
* @param int $comment_id ID of the new comment.
[4029] Fix | Delete
* @param array $args An array of new comment arguments.
[4030] Fix | Delete
*/
[4031] Fix | Delete
do_action( 'xmlrpc_call_success_wp_newComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
[4032] Fix | Delete
[4033] Fix | Delete
return $comment_id;
[4034] Fix | Delete
}
[4035] Fix | Delete
[4036] Fix | Delete
/**
[4037] Fix | Delete
* Retrieves all of the comment status.
[4038] Fix | Delete
*
[4039] Fix | Delete
* @since 2.7.0
[4040] Fix | Delete
*
[4041] Fix | Delete
* @param array $args {
[4042] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4043] Fix | Delete
*
[4044] Fix | Delete
* @type int $0 Blog ID (unused).
[4045] Fix | Delete
* @type string $1 Username.
[4046] Fix | Delete
* @type string $2 Password.
[4047] Fix | Delete
* }
[4048] Fix | Delete
* @return array|IXR_Error
[4049] Fix | Delete
*/
[4050] Fix | Delete
public function wp_getCommentStatusList( $args ) {
[4051] Fix | Delete
$this->escape( $args );
[4052] Fix | Delete
[4053] Fix | Delete
$username = $args[1];
[4054] Fix | Delete
$password = $args[2];
[4055] Fix | Delete
[4056] Fix | Delete
$user = $this->login( $username, $password );
[4057] Fix | Delete
if ( ! $user ) {
[4058] Fix | Delete
return $this->error;
[4059] Fix | Delete
}
[4060] Fix | Delete
[4061] Fix | Delete
if ( ! current_user_can( 'publish_posts' ) ) {
[4062] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );
[4063] Fix | Delete
}
[4064] Fix | Delete
[4065] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4066] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getCommentStatusList', $args, $this );
[4067] Fix | Delete
[4068] Fix | Delete
return get_comment_statuses();
[4069] Fix | Delete
}
[4070] Fix | Delete
[4071] Fix | Delete
/**
[4072] Fix | Delete
* Retrieves comment counts.
[4073] Fix | Delete
*
[4074] Fix | Delete
* @since 2.5.0
[4075] Fix | Delete
*
[4076] Fix | Delete
* @param array $args {
[4077] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4078] Fix | Delete
*
[4079] Fix | Delete
* @type int $0 Blog ID (unused).
[4080] Fix | Delete
* @type string $1 Username.
[4081] Fix | Delete
* @type string $2 Password.
[4082] Fix | Delete
* @type int $3 Post ID.
[4083] Fix | Delete
* }
[4084] Fix | Delete
* @return array|IXR_Error
[4085] Fix | Delete
*/
[4086] Fix | Delete
public function wp_getCommentCount( $args ) {
[4087] Fix | Delete
$this->escape( $args );
[4088] Fix | Delete
[4089] Fix | Delete
$username = $args[1];
[4090] Fix | Delete
$password = $args[2];
[4091] Fix | Delete
$post_id = (int) $args[3];
[4092] Fix | Delete
[4093] Fix | Delete
$user = $this->login( $username, $password );
[4094] Fix | Delete
if ( ! $user ) {
[4095] Fix | Delete
return $this->error;
[4096] Fix | Delete
}
[4097] Fix | Delete
[4098] Fix | Delete
$post = get_post( $post_id, ARRAY_A );
[4099] Fix | Delete
if ( empty( $post['ID'] ) ) {
[4100] Fix | Delete
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
[4101] Fix | Delete
}
[4102] Fix | Delete
[4103] Fix | Delete
if ( ! current_user_can( 'edit_post', $post_id ) ) {
[4104] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to access details of this post.' ) );
[4105] Fix | Delete
}
[4106] Fix | Delete
[4107] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4108] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getCommentCount', $args, $this );
[4109] Fix | Delete
[4110] Fix | Delete
$count = wp_count_comments( $post_id );
[4111] Fix | Delete
[4112] Fix | Delete
return array(
[4113] Fix | Delete
'approved' => $count->approved,
[4114] Fix | Delete
'awaiting_moderation' => $count->moderated,
[4115] Fix | Delete
'spam' => $count->spam,
[4116] Fix | Delete
'total_comments' => $count->total_comments,
[4117] Fix | Delete
);
[4118] Fix | Delete
}
[4119] Fix | Delete
[4120] Fix | Delete
/**
[4121] Fix | Delete
* Retrieves post statuses.
[4122] Fix | Delete
*
[4123] Fix | Delete
* @since 2.5.0
[4124] Fix | Delete
*
[4125] Fix | Delete
* @param array $args {
[4126] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4127] Fix | Delete
*
[4128] Fix | Delete
* @type int $0 Blog ID (unused).
[4129] Fix | Delete
* @type string $1 Username.
[4130] Fix | Delete
* @type string $2 Password.
[4131] Fix | Delete
* }
[4132] Fix | Delete
* @return array|IXR_Error
[4133] Fix | Delete
*/
[4134] Fix | Delete
public function wp_getPostStatusList( $args ) {
[4135] Fix | Delete
$this->escape( $args );
[4136] Fix | Delete
[4137] Fix | Delete
$username = $args[1];
[4138] Fix | Delete
$password = $args[2];
[4139] Fix | Delete
[4140] Fix | Delete
$user = $this->login( $username, $password );
[4141] Fix | Delete
if ( ! $user ) {
[4142] Fix | Delete
return $this->error;
[4143] Fix | Delete
}
[4144] Fix | Delete
[4145] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[4146] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );
[4147] Fix | Delete
}
[4148] Fix | Delete
[4149] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4150] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getPostStatusList', $args, $this );
[4151] Fix | Delete
[4152] Fix | Delete
return get_post_statuses();
[4153] Fix | Delete
}
[4154] Fix | Delete
[4155] Fix | Delete
/**
[4156] Fix | Delete
* Retrieves page statuses.
[4157] Fix | Delete
*
[4158] Fix | Delete
* @since 2.5.0
[4159] Fix | Delete
*
[4160] Fix | Delete
* @param array $args {
[4161] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4162] Fix | Delete
*
[4163] Fix | Delete
* @type int $0 Blog ID (unused).
[4164] Fix | Delete
* @type string $1 Username.
[4165] Fix | Delete
* @type string $2 Password.
[4166] Fix | Delete
* }
[4167] Fix | Delete
* @return array|IXR_Error
[4168] Fix | Delete
*/
[4169] Fix | Delete
public function wp_getPageStatusList( $args ) {
[4170] Fix | Delete
$this->escape( $args );
[4171] Fix | Delete
[4172] Fix | Delete
$username = $args[1];
[4173] Fix | Delete
$password = $args[2];
[4174] Fix | Delete
[4175] Fix | Delete
$user = $this->login( $username, $password );
[4176] Fix | Delete
if ( ! $user ) {
[4177] Fix | Delete
return $this->error;
[4178] Fix | Delete
}
[4179] Fix | Delete
[4180] Fix | Delete
if ( ! current_user_can( 'edit_pages' ) ) {
[4181] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );
[4182] Fix | Delete
}
[4183] Fix | Delete
[4184] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4185] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getPageStatusList', $args, $this );
[4186] Fix | Delete
[4187] Fix | Delete
return get_page_statuses();
[4188] Fix | Delete
}
[4189] Fix | Delete
[4190] Fix | Delete
/**
[4191] Fix | Delete
* Retrieves page templates.
[4192] Fix | Delete
*
[4193] Fix | Delete
* @since 2.6.0
[4194] Fix | Delete
*
[4195] Fix | Delete
* @param array $args {
[4196] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4197] Fix | Delete
*
[4198] Fix | Delete
* @type int $0 Blog ID (unused).
[4199] Fix | Delete
* @type string $1 Username.
[4200] Fix | Delete
* @type string $2 Password.
[4201] Fix | Delete
* }
[4202] Fix | Delete
* @return array|IXR_Error
[4203] Fix | Delete
*/
[4204] Fix | Delete
public function wp_getPageTemplates( $args ) {
[4205] Fix | Delete
$this->escape( $args );
[4206] Fix | Delete
[4207] Fix | Delete
$username = $args[1];
[4208] Fix | Delete
$password = $args[2];
[4209] Fix | Delete
[4210] Fix | Delete
$user = $this->login( $username, $password );
[4211] Fix | Delete
if ( ! $user ) {
[4212] Fix | Delete
return $this->error;
[4213] Fix | Delete
}
[4214] Fix | Delete
[4215] Fix | Delete
if ( ! current_user_can( 'edit_pages' ) ) {
[4216] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );
[4217] Fix | Delete
}
[4218] Fix | Delete
[4219] Fix | Delete
$templates = get_page_templates();
[4220] Fix | Delete
$templates['Default'] = 'default';
[4221] Fix | Delete
[4222] Fix | Delete
return $templates;
[4223] Fix | Delete
}
[4224] Fix | Delete
[4225] Fix | Delete
/**
[4226] Fix | Delete
* Retrieves blog options.
[4227] Fix | Delete
*
[4228] Fix | Delete
* @since 2.6.0
[4229] Fix | Delete
*
[4230] Fix | Delete
* @param array $args {
[4231] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4232] Fix | Delete
*
[4233] Fix | Delete
* @type int $0 Blog ID (unused).
[4234] Fix | Delete
* @type string $1 Username.
[4235] Fix | Delete
* @type string $2 Password.
[4236] Fix | Delete
* @type array $3 Optional. Options.
[4237] Fix | Delete
* }
[4238] Fix | Delete
* @return array|IXR_Error
[4239] Fix | Delete
*/
[4240] Fix | Delete
public function wp_getOptions( $args ) {
[4241] Fix | Delete
$this->escape( $args );
[4242] Fix | Delete
[4243] Fix | Delete
$username = $args[1];
[4244] Fix | Delete
$password = $args[2];
[4245] Fix | Delete
$options = isset( $args[3] ) ? (array) $args[3] : array();
[4246] Fix | Delete
[4247] Fix | Delete
$user = $this->login( $username, $password );
[4248] Fix | Delete
if ( ! $user ) {
[4249] Fix | Delete
return $this->error;
[4250] Fix | Delete
}
[4251] Fix | Delete
[4252] Fix | Delete
// If no specific options where asked for, return all of them.
[4253] Fix | Delete
if ( count( $options ) === 0 ) {
[4254] Fix | Delete
$options = array_keys( $this->blog_options );
[4255] Fix | Delete
}
[4256] Fix | Delete
[4257] Fix | Delete
return $this->_getOptions( $options );
[4258] Fix | Delete
}
[4259] Fix | Delete
[4260] Fix | Delete
/**
[4261] Fix | Delete
* Retrieves blog options value from list.
[4262] Fix | Delete
*
[4263] Fix | Delete
* @since 2.6.0
[4264] Fix | Delete
*
[4265] Fix | Delete
* @param array $options Options to retrieve.
[4266] Fix | Delete
* @return array
[4267] Fix | Delete
*/
[4268] Fix | Delete
public function _getOptions( $options ) {
[4269] Fix | Delete
$data = array();
[4270] Fix | Delete
$can_manage = current_user_can( 'manage_options' );
[4271] Fix | Delete
foreach ( $options as $option ) {
[4272] Fix | Delete
if ( array_key_exists( $option, $this->blog_options ) ) {
[4273] Fix | Delete
$data[ $option ] = $this->blog_options[ $option ];
[4274] Fix | Delete
// Is the value static or dynamic?
[4275] Fix | Delete
if ( isset( $data[ $option ]['option'] ) ) {
[4276] Fix | Delete
$data[ $option ]['value'] = get_option( $data[ $option ]['option'] );
[4277] Fix | Delete
unset( $data[ $option ]['option'] );
[4278] Fix | Delete
}
[4279] Fix | Delete
[4280] Fix | Delete
if ( ! $can_manage ) {
[4281] Fix | Delete
$data[ $option ]['readonly'] = true;
[4282] Fix | Delete
}
[4283] Fix | Delete
}
[4284] Fix | Delete
}
[4285] Fix | Delete
[4286] Fix | Delete
return $data;
[4287] Fix | Delete
}
[4288] Fix | Delete
[4289] Fix | Delete
/**
[4290] Fix | Delete
* Updates blog options.
[4291] Fix | Delete
*
[4292] Fix | Delete
* @since 2.6.0
[4293] Fix | Delete
*
[4294] Fix | Delete
* @param array $args {
[4295] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4296] Fix | Delete
*
[4297] Fix | Delete
* @type int $0 Blog ID (unused).
[4298] Fix | Delete
* @type string $1 Username.
[4299] Fix | Delete
* @type string $2 Password.
[4300] Fix | Delete
* @type array $3 Options.
[4301] Fix | Delete
* }
[4302] Fix | Delete
* @return array|IXR_Error
[4303] Fix | Delete
*/
[4304] Fix | Delete
public function wp_setOptions( $args ) {
[4305] Fix | Delete
$this->escape( $args );
[4306] Fix | Delete
[4307] Fix | Delete
$username = $args[1];
[4308] Fix | Delete
$password = $args[2];
[4309] Fix | Delete
$options = (array) $args[3];
[4310] Fix | Delete
[4311] Fix | Delete
$user = $this->login( $username, $password );
[4312] Fix | Delete
if ( ! $user ) {
[4313] Fix | Delete
return $this->error;
[4314] Fix | Delete
}
[4315] Fix | Delete
[4316] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[4317] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to update options.' ) );
[4318] Fix | Delete
}
[4319] Fix | Delete
[4320] Fix | Delete
$option_names = array();
[4321] Fix | Delete
foreach ( $options as $o_name => $o_value ) {
[4322] Fix | Delete
$option_names[] = $o_name;
[4323] Fix | Delete
if ( ! array_key_exists( $o_name, $this->blog_options ) ) {
[4324] Fix | Delete
continue;
[4325] Fix | Delete
}
[4326] Fix | Delete
[4327] Fix | Delete
if ( true == $this->blog_options[ $o_name ]['readonly'] ) {
[4328] Fix | Delete
continue;
[4329] Fix | Delete
}
[4330] Fix | Delete
[4331] Fix | Delete
update_option( $this->blog_options[ $o_name ]['option'], wp_unslash( $o_value ) );
[4332] Fix | Delete
}
[4333] Fix | Delete
[4334] Fix | Delete
// Now return the updated values.
[4335] Fix | Delete
return $this->_getOptions( $option_names );
[4336] Fix | Delete
}
[4337] Fix | Delete
[4338] Fix | Delete
/**
[4339] Fix | Delete
* Retrieves a media item by ID.
[4340] Fix | Delete
*
[4341] Fix | Delete
* @since 3.1.0
[4342] Fix | Delete
*
[4343] Fix | Delete
* @param array $args {
[4344] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4345] Fix | Delete
*
[4346] Fix | Delete
* @type int $0 Blog ID (unused).
[4347] Fix | Delete
* @type string $1 Username.
[4348] Fix | Delete
* @type string $2 Password.
[4349] Fix | Delete
* @type int $3 Attachment ID.
[4350] Fix | Delete
* }
[4351] Fix | Delete
* @return array|IXR_Error Associative array contains:
[4352] Fix | Delete
* - 'date_created_gmt'
[4353] Fix | Delete
* - 'parent'
[4354] Fix | Delete
* - 'link'
[4355] Fix | Delete
* - 'thumbnail'
[4356] Fix | Delete
* - 'title'
[4357] Fix | Delete
* - 'caption'
[4358] Fix | Delete
* - 'description'
[4359] Fix | Delete
* - 'metadata'
[4360] Fix | Delete
*/
[4361] Fix | Delete
public function wp_getMediaItem( $args ) {
[4362] Fix | Delete
$this->escape( $args );
[4363] Fix | Delete
[4364] Fix | Delete
$username = $args[1];
[4365] Fix | Delete
$password = $args[2];
[4366] Fix | Delete
$attachment_id = (int) $args[3];
[4367] Fix | Delete
[4368] Fix | Delete
$user = $this->login( $username, $password );
[4369] Fix | Delete
if ( ! $user ) {
[4370] Fix | Delete
return $this->error;
[4371] Fix | Delete
}
[4372] Fix | Delete
[4373] Fix | Delete
if ( ! current_user_can( 'upload_files' ) ) {
[4374] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to upload files.' ) );
[4375] Fix | Delete
}
[4376] Fix | Delete
[4377] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4378] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getMediaItem', $args, $this );
[4379] Fix | Delete
[4380] Fix | Delete
$attachment = get_post( $attachment_id );
[4381] Fix | Delete
if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
[4382] Fix | Delete
return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
[4383] Fix | Delete
}
[4384] Fix | Delete
[4385] Fix | Delete
return $this->_prepare_media_item( $attachment );
[4386] Fix | Delete
}
[4387] Fix | Delete
[4388] Fix | Delete
/**
[4389] Fix | Delete
* Retrieves a collection of media library items (or attachments).
[4390] Fix | Delete
*
[4391] Fix | Delete
* Besides the common blog_id (unused), username, and password arguments,
[4392] Fix | Delete
* it takes a filter array as the last argument.
[4393] Fix | Delete
*
[4394] Fix | Delete
* Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'.
[4395] Fix | Delete
*
[4396] Fix | Delete
* The defaults are as follows:
[4397] Fix | Delete
* - 'number' - Default is 5. Total number of media items to retrieve.
[4398] Fix | Delete
* - 'offset' - Default is 0. See WP_Query::query() for more.
[4399] Fix | Delete
* - 'parent_id' - Default is ''. The post where the media item is attached.
[4400] Fix | Delete
* Empty string shows all media items. 0 shows unattached media items.
[4401] Fix | Delete
* - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf')
[4402] Fix | Delete
*
[4403] Fix | Delete
* @since 3.1.0
[4404] Fix | Delete
*
[4405] Fix | Delete
* @param array $args {
[4406] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4407] Fix | Delete
*
[4408] Fix | Delete
* @type int $0 Blog ID (unused).
[4409] Fix | Delete
* @type string $1 Username.
[4410] Fix | Delete
* @type string $2 Password.
[4411] Fix | Delete
* @type array $3 Optional. Query arguments.
[4412] Fix | Delete
* }
[4413] Fix | Delete
* @return array|IXR_Error Array containing a collection of media items.
[4414] Fix | Delete
* See wp_xmlrpc_server::wp_getMediaItem() for a description
[4415] Fix | Delete
* of each item contents.
[4416] Fix | Delete
*/
[4417] Fix | Delete
public function wp_getMediaLibrary( $args ) {
[4418] Fix | Delete
$this->escape( $args );
[4419] Fix | Delete
[4420] Fix | Delete
$username = $args[1];
[4421] Fix | Delete
$password = $args[2];
[4422] Fix | Delete
$struct = isset( $args[3] ) ? $args[3] : array();
[4423] Fix | Delete
[4424] Fix | Delete
$user = $this->login( $username, $password );
[4425] Fix | Delete
if ( ! $user ) {
[4426] Fix | Delete
return $this->error;
[4427] Fix | Delete
}
[4428] Fix | Delete
[4429] Fix | Delete
if ( ! current_user_can( 'upload_files' ) ) {
[4430] Fix | Delete
return new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );
[4431] Fix | Delete
}
[4432] Fix | Delete
[4433] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4434] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getMediaLibrary', $args, $this );
[4435] Fix | Delete
[4436] Fix | Delete
$parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : '';
[4437] Fix | Delete
$mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : '';
[4438] Fix | Delete
$offset = ( isset( $struct['offset'] ) ) ? absint( $struct['offset'] ) : 0;
[4439] Fix | Delete
$number = ( isset( $struct['number'] ) ) ? absint( $struct['number'] ) : -1;
[4440] Fix | Delete
[4441] Fix | Delete
$attachments = get_posts(
[4442] Fix | Delete
array(
[4443] Fix | Delete
'post_type' => 'attachment',
[4444] Fix | Delete
'post_parent' => $parent_id,
[4445] Fix | Delete
'offset' => $offset,
[4446] Fix | Delete
'numberposts' => $number,
[4447] Fix | Delete
'post_mime_type' => $mime_type,
[4448] Fix | Delete
)
[4449] Fix | Delete
);
[4450] Fix | Delete
[4451] Fix | Delete
$attachments_struct = array();
[4452] Fix | Delete
[4453] Fix | Delete
foreach ( $attachments as $attachment ) {
[4454] Fix | Delete
$attachments_struct[] = $this->_prepare_media_item( $attachment );
[4455] Fix | Delete
}
[4456] Fix | Delete
[4457] Fix | Delete
return $attachments_struct;
[4458] Fix | Delete
}
[4459] Fix | Delete
[4460] Fix | Delete
/**
[4461] Fix | Delete
* Retrieves a list of post formats used by the site.
[4462] Fix | Delete
*
[4463] Fix | Delete
* @since 3.1.0
[4464] Fix | Delete
*
[4465] Fix | Delete
* @param array $args {
[4466] Fix | Delete
* Method arguments. Note: arguments must be ordered as documented.
[4467] Fix | Delete
*
[4468] Fix | Delete
* @type int $0 Blog ID (unused).
[4469] Fix | Delete
* @type string $1 Username.
[4470] Fix | Delete
* @type string $2 Password.
[4471] Fix | Delete
* }
[4472] Fix | Delete
* @return array|IXR_Error List of post formats, otherwise IXR_Error object.
[4473] Fix | Delete
*/
[4474] Fix | Delete
public function wp_getPostFormats( $args ) {
[4475] Fix | Delete
$this->escape( $args );
[4476] Fix | Delete
[4477] Fix | Delete
$username = $args[1];
[4478] Fix | Delete
$password = $args[2];
[4479] Fix | Delete
[4480] Fix | Delete
$user = $this->login( $username, $password );
[4481] Fix | Delete
if ( ! $user ) {
[4482] Fix | Delete
return $this->error;
[4483] Fix | Delete
}
[4484] Fix | Delete
[4485] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[4486] Fix | Delete
return new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );
[4487] Fix | Delete
}
[4488] Fix | Delete
[4489] Fix | Delete
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
[4490] Fix | Delete
do_action( 'xmlrpc_call', 'wp.getPostFormats', $args, $this );
[4491] Fix | Delete
[4492] Fix | Delete
$formats = get_post_format_strings();
[4493] Fix | Delete
[4494] Fix | Delete
// Find out if they want a list of currently supports formats.
[4495] Fix | Delete
if ( isset( $args[3] ) && is_array( $args[3] ) ) {
[4496] Fix | Delete
if ( $args[3]['show-supported'] ) {
[4497] Fix | Delete
if ( current_theme_supports( 'post-formats' ) ) {
[4498] Fix | Delete
$supported = get_theme_support( 'post-formats' );
[4499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function