| @@ -212,10 +212,9 @@ | ||
| 212 | 212 | try { |
| 213 | 213 | $iterator = new DirectoryIterator( $dir_path ); |
| 214 | 214 | foreach ( $iterator as $file_info ) { |
| 215 | 215 | if ( $file_info->isFile() ) { |
| 216 | - // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_unlink -- Deleting temporary files in wp_upload_dir(). | |
| 217 | - unlink( $file_info->getPathname() ); | |
| 216 | + wp_delete_file( $file_info->getPathname() ); | |
| 218 | 217 | } |
| 219 | 218 | } |
| 220 | 219 | } catch ( Exception $e ) { |
| 221 | 220 | return; |
| @@ -220,10 +219,13 @@ | ||
| 220 | 219 | } catch ( Exception $e ) { |
| 221 | 220 | return; |
| 222 | 221 | } |
| 223 | 222 | |
| 224 | - // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.directory_rmdir -- Deleting temporary directory in wp_upload_dir(). | |
| 225 | - rmdir( $dir_path ); | |
| 223 | + $wp_filesystem = WINP_Helper::get_wp_filesystem(); | |
| 224 | + | |
| 225 | + if ( false !== $wp_filesystem ) { | |
| 226 | + $wp_filesystem->rmdir( $dir_path, true ); | |
| 227 | + } | |
| 226 | 228 | } |
| 227 | 229 | |
| 228 | 230 | /** |
| 229 | 231 | * Update taxonomy tags |
| @@ -292,8 +294,9 @@ | ||
| 292 | 294 | $this->update_meta( $snippet['id'], 'snippet_description', $snippet['description'] ); |
| 293 | 295 | $this->update_meta( $snippet['id'], 'snippet_tags', $snippet['attributes'] ); |
| 294 | 296 | $this->update_meta( $snippet['id'], 'snippet_activate', 0 ); |
| 295 | 297 | $this->update_meta( $snippet['id'], 'snippet_priority', $snippet['priority'] ); |
| 298 | + $this->update_meta( $snippet['id'], 'snippet_custom_name', $snippet['custom_name'] ); | |
| 296 | 299 | |
| 297 | 300 | $this->update_taxonomy_tags( $snippet['id'], $snippet['tags'] ); |
| 298 | 301 | |
| 299 | 302 | return $snippet['id']; |