ACF_Admin_Internal_Post_Type_List::get_human_readable_file_location
Returns a human-readable file location.
Метод класса: ACF_Admin_Internal_Post_Type_List{}
Хуков нет.
Возвращает
Строку.
Использование
$ACF_Admin_Internal_Post_Type_List = new ACF_Admin_Internal_Post_Type_List(); $ACF_Admin_Internal_Post_Type_List->get_human_readable_file_location( $file );
- $file(строка) (обязательный)
- The full file path.
Список изменений
| С версии 5.9.0 | Введена. |
Код ACF_Admin_Internal_Post_Type_List::get_human_readable_file_location() ACF Admin Internal Post Type List::get human readable file location ACF 6.4.2
public function get_human_readable_file_location( $file ) {
// Generate friendly file path.
$theme_path = get_stylesheet_directory();
if ( strpos( $file, $theme_path ) !== false ) {
$rel_file = str_replace( $theme_path, '', $file );
$located = sprintf( __( 'Located in theme: %s', 'acf' ), $rel_file );
} elseif ( strpos( $file, WP_PLUGIN_DIR ) !== false ) {
$rel_file = str_replace( WP_PLUGIN_DIR, '', $file );
$located = sprintf( __( 'Located in plugin: %s', 'acf' ), $rel_file );
} else {
$rel_file = str_replace( ABSPATH, '', $file );
$located = sprintf( __( 'Located in: %s', 'acf' ), $rel_file );
}
return $located;
}