wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_basename › WordPress Function

Since3.1.0
Deprecatedn/a
wp_basename ( $path, $suffix = '' )
Parameters: (2)
  • (string) $path A path.
    Required: Yes
  • (string) $suffix If the filename ends in suffix this will also be cut off.
    Required: No
    Default: (empty)
Returns:
  • (string)
Defined at:
Codex:

i18n-friendly version of basename().



Source

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