Changeset 59855
- Timestamp:
- 02/21/2025 08:23:34 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor.php
r59473 r59855 434 434 * 435 435 * @since 3.5.0 436 * @since 6.8.0 Passing an empty string as $suffix will now omit the suffix from the generated filename. 436 437 * 437 438 * @param string $suffix … … 441 442 */ 442 443 public function generate_filename( $suffix = null, $dest_path = null, $extension = null ) { 443 // $suffix will be appended to the destination filename, just before the extension. 444 if ( ! $suffix ) { 445 $suffix = $this->get_suffix(); 444 // If not empty the $suffix will be appended to the destination filename, just before the extension. 445 if ( $suffix ) { 446 $suffix = '-' . $suffix; 447 } elseif ( '' !== $suffix ) { 448 $suffix = '-' . $this->get_suffix(); 446 449 } 447 450 … … 463 466 } 464 467 465 return trailingslashit( $dir ) . "{$name} -{$suffix}.{$new_ext}";468 return trailingslashit( $dir ) . "{$name}{$suffix}.{$new_ext}"; 466 469 } 467 470
Note: See TracChangeset
for help on using the changeset viewer.