ACF_Admin_Field_Groups::get_human_readable_file_location()
Returns a human readable file location.
Метод класса: ACF_Admin_Field_Groups{}
Хуков нет.
Возвращает
Строку
.
Использование
$ACF_Admin_Field_Groups = new ACF_Admin_Field_Groups(); $ACF_Admin_Field_Groups->get_human_readable_file_location( $file );
- $file(строка) (обязательный)
- The full file path.
Список изменений
С версии 5.9.0 | Введена. |
Код ACF_Admin_Field_Groups::get_human_readable_file_location() ACF Admin Field Groups::get human readable file location ACF 6.0.4
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; }