wp_basename( string $path, string $suffix = '' )

i18n friendly version of basename()


Description Description


Parameters Parameters

$path

(string) (Required) A path.

$suffix

(string) (Optional) If the filename ends in suffix this will also be cut off.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: wp-includes/formatting.php

function wp_basename( $path, $suffix = '' ) {
	return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.