上传个人资料图片时,在BuddyPress中上传封面图片时出现问题?

时间:2018-03-07 作者:Zaheer Abbas

我正在工作的二十五个主题上传巴迪新闻插件一切都很好。但当我上传档案封面图片时,上面显示的错误,封面图片大小是900 x 600。任何帮助都将不胜感激。

1 个回复
SO网友:Harshal Khairnar

只需更改/wp内容/插件/buddypress/bp核心/bp核心附件。php文件

    }
    // Make sure the file path is safe.
    if ( 0 !== validate_file( $r[\'image\'] ) ) { //this to following one
    if ( 1 === validate_file( $r[\'image\'] ) ) {
                return false;
    }


    $type_subdir = $r[\'object_dir\'] . \'/\' . $r[\'item_id\'] . \'/\' . $r[\'type\'];
    $type_dir    = trailingslashit( $bp_attachments_uploads_dir[\'basedir\'] ) . $type_subdir;

    if ( 0 !== validate_file( $type_dir ) || ! is_dir( $type_dir ) ) { //this to following one
    if ( 1 === validate_file( $type_dir ) || ! is_dir( $type_dir ) ) {
                return $attachment_data;
    }


    $cover_subdir = $object_data[\'dir\'] . \'/\' . $bp_params[\'item_id\'] . \'/cover-image\';
    $cover_dir    = trailingslashit( $bp_attachments_uploads_dir[\'basedir\'] ) . $cover_subdir;

    if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) { //this to following one
    if ( 1 === validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {
    // Upload error response.
    bp_attachments_json_response( false, $is_html4, array(
               \'type\'    => \'upload_error\',

结束