ACF_UI_Options_Page::include_json_options_pages
Includes all local JSON options pages.
Метод класса: ACF_UI_Options_Page{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ACF_UI_Options_Page = new ACF_UI_Options_Page(); $ACF_UI_Options_Page->include_json_options_pages();
Список изменений
| С версии 6.1 | Введена. |
Код ACF_UI_Options_Page::include_json_options_pages() ACF UI Options Page::include json options pages ACF 6.4.2
public function include_json_options_pages() {
$local_json = acf_get_instance( 'ACF_Local_JSON' );
// Bail early if disabled.
if ( ! $local_json->is_enabled() ) {
return;
}
// Get load paths.
$files = $local_json->scan_files( 'acf-ui-options-page' );
foreach ( $files as $key => $file ) {
$json = json_decode( file_get_contents( $file ), true );
$json['local'] = 'json';
$json['local_file'] = $file;
acf_add_local_internal_post_type( $json, 'acf-ui-options-page' );
}
}