acf_pro::invalid_license_redirect_noticepublicACF 6.2.8

Adds a notice if a user has attempted to edit an ACF item without a valid license.

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

Хуков нет.

Возвращает

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

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

$acf_pro = new acf_pro();
$acf_pro->invalid_license_redirect_notice( $post_type );
$post_type(строка) (обязательный)
The post type being edited.

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

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

Код acf_pro::invalid_license_redirect_notice() ACF 6.4.2

public function invalid_license_redirect_notice( string $post_type ) {
	if ( ! acf_request_arg( 'acf_invalid_license', false ) ) {
		return;
	}

	if ( 'acf-field-group' === $post_type ) {
		acf_add_admin_notice( __( 'A valid license is required to edit field groups assigned to a block.', 'acf' ), 'error' );
	} elseif ( 'acf-ui-options-page' === $post_type ) {
		acf_add_admin_notice( __( 'A valid license is required to edit options pages.', 'acf' ), 'error' );
	}
}