ACF_UI_Options_Page::include_json_options_pages
Includes all local JSON options pages.
Method of the class: ACF_UI_Options_Page{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ACF_UI_Options_Page = new ACF_UI_Options_Page(); $ACF_UI_Options_Page->include_json_options_pages();
Changelog
| Since 6.1 | Introduced. |
ACF_UI_Options_Page::include_json_options_pages() ACF UI Options Page::include json options pages code ACF 6.8.8
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' );
}
}