WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp basename

Description

i18n friendly version of basename()

Usage

<?php wp_basename$path$suffix ?>

Parameters

$path
(string) (required) A path.
Default: None
$suffix
(string) (optional) If the file name ends in suffix this will also be cut off.
Default: ''

Return Values

(string) 

Examples

Notes

Change Log

Since: 3.1.0

Source File

wp_basename() is located in /wp-includes/formatting.php.

Related