wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_delete_file › WordPress Function

Od4.2.0
Przestarzałyn/a
wp_delete_file ( $file )
Parametry:
  • (string) $file The path to the file to delete.
    Wymagane: Tak
Powrót:
  • (bool) True on success, false on failure.
Zdefiniowane na:
Codex:
Dziennik zmian:
  • 6.7.0

Deletes a file.



Źródło

function wp_delete_file( $file ) {
	/**
	 * Filters the path of the file to delete.
	 *
	 * @since 2.1.0
	 *
	 * @param string $file Path to the file to delete.
	 */
	$delete = apply_filters( 'wp_delete_file', $file );

	if ( ! empty( $delete ) ) {
		return @unlink( $delete );
	}

	return false;
}