_get_template_edit_filename

Tidies a filename for url display by the theme editor.

Description

(string) _get_template_edit_filename( (string) $fullpath, (string) $containingfolder ); 

Returns (string)

Parameters (2)

0. $fullpath (string)
Full path to the theme file
1. $containingfolder (string)
Path of the theme parent folder

Usage

  1. if ( !function_exists( '_get_template_edit_filename' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/theme.php'; 
  3.  
  4. // Full path to the theme file 
  5. $fullpath = ''; 
  6.  
  7. // Path of the theme parent folder 
  8. $containingfolder = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = _get_template_edit_filename($fullpath, $containingfolder); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/theme.php  
  1. function _get_template_edit_filename($fullpath, $containingfolder) { 
  2. return str_replace(dirname(dirname( $containingfolder )) , '', $fullpath);