wpcf7_not_allowed_to_edit()CF7 1.0

Хуков нет.

Возвращает

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

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

wpcf7_not_allowed_to_edit( $page, $action, $object );
$page (обязательный)
-
$action (обязательный)
-
$object (обязательный)
-

Код wpcf7_not_allowed_to_edit() CF7 5.9.8

function wpcf7_not_allowed_to_edit( $page, $action, $object ) {
	if ( $object instanceof WPCF7_ContactForm ) {
		$contact_form = $object;
	} else {
		return;
	}

	if ( current_user_can( 'wpcf7_edit_contact_form', $contact_form->id() ) ) {
		return;
	}

	$message = __( "You are not allowed to edit this contact form.", 'contact-form-7' );

	echo sprintf(
		'<div class="notice notice-warning"><p>%s</p></div>',
		esc_html( $message )
	);
}