ACF_Admin::maybe_show_import_from_cptui_notice
Shows a notice to import post types and taxonomies from CPTUI if that plugin is active.
Метод класса: ACF_Admin{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ACF_Admin = new ACF_Admin(); $ACF_Admin->maybe_show_import_from_cptui_notice();
Список изменений
| С версии 6.1 | Введена. |
Код ACF_Admin::maybe_show_import_from_cptui_notice() ACF Admin::maybe show import from cptui notice ACF 6.4.2
public function maybe_show_import_from_cptui_notice() {
global $plugin_page;
// Only show if CPTUI is active and post types are enabled.
if ( ! acf_get_setting( 'enable_post_types' ) || ! is_plugin_active( 'custom-post-type-ui/custom-post-type-ui.php' ) ) {
return;
}
// No need to show on the tools page.
if ( 'acf-tools' === $plugin_page ) {
return;
}
$text = sprintf(
/* translators: %s - URL to ACF tools page. */
__( 'Import Post Types and Taxonomies registered with Custom Post Type UI and manage them with ACF. <a href="%s">Get Started</a>.', 'acf' ),
acf_get_admin_tools_url()
);
acf_add_admin_notice( $text, 'success', true, true );
}