ACF_Admin_UI_Options_Page::options_page_created_messagepublicACF 6.1

Renders the options page created message.

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

Хуков нет.

Возвращает

string.

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

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

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

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

Код ACF_Admin_UI_Options_Page::options_page_created_message() ACF 6.8.8

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

	$title = get_the_title( $post_id );

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

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

	$add_fields_link = wp_nonce_url(
		admin_url( 'post-new.php?post_type=acf-field-group&use_options_page=' . $post_id ),
		'add-fields-' . $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 echo esc_html( $add_fields_text ); ?></a>
		<a class="acf-link-field-groups" href="#"><?php esc_html_e( 'Link existing field groups', 'acf' ); ?></a>
	</div>
	<?php
	return ob_get_clean();
}