ACF_Admin_Post_type::post_type_created_message
Renders the post type created message.
Метод класса: ACF_Admin_Post_type{}
Хуков нет.
Возвращает
Строку.
Использование
$ACF_Admin_Post_type = new ACF_Admin_Post_type(); $ACF_Admin_Post_type->post_type_created_message( $created );
- $created(true|false)
- True if the post was just created.
По умолчанию:false
Список изменений
| С версии 6.1 | Введена. |
Код ACF_Admin_Post_type::post_type_created_message() ACF Admin Post type::post type created message ACF 6.4.2
<?php
public function post_type_created_message( $created = false ) {
global $post_id;
$title = get_the_title( $post_id );
/* translators: %s post type name */
$item_saved_text = sprintf( __( '%s post type updated', 'acf' ), $title );
if ( $created ) {
/* translators: %s post type name */
$item_saved_text = sprintf( __( '%s post type created', 'acf' ), $title );
}
$add_fields_link = wp_nonce_url(
admin_url( 'post-new.php?post_type=acf-field-group&use_post_type=' . $post_id ),
'add-fields-' . $post_id
);
$create_post_type_link = admin_url( 'post-new.php?post_type=acf-post-type' );
$duplicate_post_type_link = wp_nonce_url(
admin_url( 'post-new.php?post_type=acf-post-type&use_post_type=' . $post_id ),
'acfduplicate-' . $post_id
);
$create_taxonomy_link = wp_nonce_url(
admin_url( 'post-new.php?post_type=acf-taxonomy&use_post_type=' . $post_id ),
'create-taxonomy-' . $post_id
);
ob_start(); ?>
<p class="acf-item-saved-text"><?php echo esc_html( $item_saved_text ); ?></p>
<div class="acf-item-saved-links">
<a href="<?php echo esc_url( $add_fields_link ); ?>"><?php esc_html_e( 'Add fields', 'acf' ); ?></a>
<a class="acf-link-field-groups" href="#"><?php esc_html_e( 'Link field groups', 'acf' ); ?></a>
<a href="<?php echo esc_url( $create_post_type_link ); ?>"><?php esc_html_e( 'Create post type', 'acf' ); ?></a>
<a href="<?php echo esc_url( $duplicate_post_type_link ); ?>"><?php esc_html_e( 'Duplicate post type', 'acf' ); ?></a>
<a href="<?php echo esc_url( $create_taxonomy_link ); ?>"><?php esc_html_e( 'Create taxonomy', 'acf' ); ?></a>
</div>
<?php
return ob_get_clean();
}