• When this plugin is activated on multisite instalation review attatchment doesn’t work properly. After review submition file url is broken because of this code

    add_filter( 'upload_dir', array( $this, 'ywar_reviews_uploaded_files' ) );
    
    public function ywar_reviews_uploaded_files( $dir_data ) {
    
    			$custom_dir = 'ywar_reviews_uploaded_files';
    			return array(
    				'path'    => $dir_data['basedir'] . '/' . $custom_dir,
    				'url'     => $dir_data['url'] . '/' . $custom_dir,
    				'subdir'  => '/' . $custom_dir,
    				'basedir' => $dir_data['error'],
    				'error'   => $dir_data['error'],
    			);
    		}

    Here is the fix I made so that function needs to look like this. Tested on musltisite and normal instalation

    public function ywar_reviews_uploaded_files( $dir_data ) {
    
    			$custom_dir = 'ywar_reviews_uploaded_files';
    			return array(
                    'path'    => $dir_data['basedir'] . '/' . $custom_dir,
                    'url'     => $dir_data['baseurl'] . '/' . $custom_dir,
                    'subdir'  => '/' . $custom_dir,
                    'basedir' => $dir_data['basedir'],
                    'error'   => $dir_data['error'],
                );
    		}
    • This topic was modified 1 year, 8 months ago by zorangimn.

    The page I need help with: [log in to see the link]

  • The topic ‘Multisite instalation’ is closed to new replies.