408 | | $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) ); |
409 | | $destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) ); |
| 408 | |
| 409 | if ( isset( $args['hook_extra']['plugin'] ) ) { |
| 410 | // Get the plugin top directory |
| 411 | $new_dest = current(explode(DIRECTORY_SEPARATOR, $args['hook_extra']['plugin'])); |
| 412 | } else { |
| 413 | $new_dest = basename( $source ); |
| 414 | } |
| 415 | |
| 416 | $remote_destination = trailingslashit( $remote_destination ) .trailingslashit( $new_dest ); |
| 417 | $destination = trailingslashit( $destination ) . trailingslashit( $new_dest ); |
| 418 | |