ACF_Admin_Taxonomy::taxonomy_saved_messagepublicACF 6.1

Renders the post type created message.

Метод класса: ACF_Admin_Taxonomy{}

Хуков нет.

Возвращает

Строку.

Использование

$ACF_Admin_Taxonomy = new ACF_Admin_Taxonomy();
$ACF_Admin_Taxonomy->taxonomy_saved_message( $created );
$created(true|false)
True if the post was just created.
По умолчанию: false

Список изменений

С версии 6.1 Введена.

Код ACF_Admin_Taxonomy::taxonomy_saved_message() ACF 6.4.2

<?php
public function taxonomy_saved_message( $created = false ) {
	global $post_id;

	$title = get_the_title( $post_id );

	/* translators: %s taxonomy name */
	$item_saved_text = sprintf( __( '%s taxonomy updated', 'acf' ), $title );
	/* translators: %s taxonomy name */
	$add_fields_text = sprintf( __( 'Add fields to %s', 'acf' ), $title );

	if ( $created ) {
		/* translators: %s taxonomy name */
		$item_saved_text = sprintf( __( '%s taxonomy created', 'acf' ), $title );
	}

	$add_fields_link = wp_nonce_url(
		admin_url( 'post-new.php?post_type=acf-field-group&use_taxonomy=' . $post_id ),
		'add-fields-' . $post_id
	);

	$create_taxonomy_link    = admin_url( 'post-new.php?post_type=acf-taxonomy' );
	$duplicate_taxonomy_link = wp_nonce_url(
		admin_url( 'post-new.php?post_type=acf-taxonomy&use_taxonomy=' . $post_id ),
		'acfduplicate-' . $post_id
	);

	$create_post_type_link = wp_nonce_url(
		admin_url( 'post-new.php?post_type=acf-post-type&use_taxonomy=' . $post_id ),
		'create-post-type-' . $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_taxonomy_link ); ?>"><?php esc_html_e( 'Create taxonomy', 'acf' ); ?></a>
		<a href="<?php echo esc_url( $duplicate_taxonomy_link ); ?>"><?php esc_html_e( 'Duplicate taxonomy', 'acf' ); ?></a>
		<a href="<?php echo esc_url( $create_post_type_link ); ?>"><?php esc_html_e( 'Create post type', 'acf' ); ?></a>
	</div>
	<?php
	return ob_get_clean();
}