plugin updates

This commit is contained in:
Tony Volpe
2024-10-11 13:25:50 -04:00
parent 5e5b879a68
commit a6fc17dcaa
391 changed files with 6812 additions and 4326 deletions

View File

@@ -511,7 +511,7 @@ class WpmfMediaFolderOption
$wpmfQueue = JuMainQueue::getInstance('wpmf');
$wpmfQueue->updateQueueTermMeta((int)$responses['folder_id'], (int)$element_id);
$wpmfQueue->updateResponses((int)$element_id, $responses);
$this->doAddImportFtpQueue($datas['path'] . DIRECTORY_SEPARATOR, (int)$responses['folder_id']);
$this->doAddImportFtpQueue($datas['path'] . DIRECTORY_SEPARATOR, (int)$responses['folder_id'], $datas['only_file']);
} else {
$upload_dir = wp_upload_dir();
$info_file = wp_check_filetype($datas['path']);
@@ -908,10 +908,11 @@ class WpmfMediaFolderOption
*
* @param string $directory Directory
* @param integer $folder_parent ID of folder parent on media library
* @param integer $only_file Import file without subdirectories
*
* @return void
*/
public function doAddImportFtpQueue($directory, $folder_parent = 0)
public function doAddImportFtpQueue($directory, $folder_parent = 0, $only_file = null)
{
if (file_exists($directory)) {
$dir_files = glob($directory . '*');
@@ -929,7 +930,7 @@ class WpmfMediaFolderOption
'folder_parent' => $folder_parent,
'action' => 'wpmf_import_ftp_to_library'
);
if (is_dir($dir_file)) {
if (is_dir($dir_file) && empty($only_file)) {
$datas['name'] = $name;
$datas['type'] = 'folder';
} else {
@@ -1315,6 +1316,7 @@ class WpmfMediaFolderOption
}
$list_import = $_POST['wpmf_list_import'];
$only_file = $_POST['wpmf_only_file'];
if ($list_import !== '') {
$lists = explode(',', $list_import);
if (in_array('', $lists)) {
@@ -1337,7 +1339,8 @@ class WpmfMediaFolderOption
'folder_parent' => 0,
'action' => 'wpmf_import_ftp_to_library',
'name' => basename($validate_path),
'type' => 'folder'
'type' => 'folder',
'only_file' => $only_file
);
$wpmfQueue = JuMainQueue::getInstance('wpmf');
@@ -1347,7 +1350,7 @@ class WpmfMediaFolderOption
} else {
$responses = json_decode($row->responses, true);
if (isset($responses['folder_id'])) {
$this->doAddImportFtpQueue($datas['path'] . DIRECTORY_SEPARATOR, (int)$responses['folder_id']);
$this->doAddImportFtpQueue($datas['path'] . DIRECTORY_SEPARATOR, (int)$responses['folder_id'], $only_file);
}
}
}