ACF::plugin_deactivated_notice()publicACF 1.0

Displays a notice when either ACF or ACF PRO is automatically deactivated.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ACF = new ACF();
$ACF->plugin_deactivated_notice();

Код ACF::plugin_deactivated_notice() ACF 6.0.4

<?php
public function plugin_deactivated_notice() {
	$deactivated_notice_id = (int) get_transient( 'acf_deactivated_notice_id' );
	if ( ! in_array( $deactivated_notice_id, array( 1, 2 ), true ) ) {
		return;
	}

	$message = __( "Advanced Custom Fields and Advanced Custom Fields PRO should not be active at the same time. We've automatically deactivated Advanced Custom Fields.", 'acf' );
	if ( 2 === $deactivated_notice_id ) {
		$message = __( "Advanced Custom Fields and Advanced Custom Fields PRO should not be active at the same time. We've automatically deactivated Advanced Custom Fields PRO.", 'acf' );
	}

	?>
	<div class="updated" style="border-left: 4px solid #ffba00;">
		<p><?php echo esc_html( $message ); ?></p>
	</div>
	<?php

	delete_transient( 'acf_deactivated_notice_id' );
}