if ( $update ) { unstick_post( $post_data['ID'
] );
} } elseif ( isset( $post_data['sticky'
] ) ) { if ( !
current_user_can( $post_type->cap->edit_others_posts
) ) { return new IXR_Error( 401,
__( 'Sorry, you are not allowed to make posts sticky.'
) );
} $sticky =
wp_validate_boolean( $post_data['sticky'
] );
if ( $sticky ) { stick_post( $post_data['ID'
] );
} else { unstick_post( $post_data['ID'
] );
} } } /**
* Helper method for wp_newPost() and wp_editPost(), containing shared logic.
*
* @since 3.4.0
*
* @see wp_insert_post()
*
* @param WP_User $user The post author if post_author isn't set in $content_struct.
* @param array|IXR_Error $content_struct Post data to insert.
* @return IXR_Error|string
*/