WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/02/2010 05:19:55 PM (10 years ago)
Author:
scribu
Message:

Introduce wp_basename() and use it for media handling. See #11887

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r16151 r16154  
    28452845
    28462846/**
     2847 * i18n friendly version of basename()
     2848 *
     2849 * @since 3.1.0
     2850 *
     2851 * @param string $path A path.
     2852 * @param string $suffix If the filename ends in suffix this will also be cut off.
     2853 * @return string
     2854 */
     2855function wp_basename( $path, $suffix = '' ) {
     2856    return urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), $suffix ) );
     2857}
     2858
     2859/**
    28472860 * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
    28482861 *
     
    28512864 * @since 3.0.0
    28522865 */
    2853 
    28542866function capital_P_dangit( $text ) {
    28552867    // Simple replacement for titles
Note: See TracChangeset for help on using the changeset viewer.