wpcf7_not_allowed_to_edit()
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wpcf7_not_allowed_to_edit( $page, $action, $object );
- $page(обязательный)
- .
- $action(обязательный)
- .
- $object(обязательный)
- .
Код wpcf7_not_allowed_to_edit() wpcf7 not allowed to edit CF7 6.1.7
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() ) ) {
wp_admin_notice(
__( 'You are not allowed to edit this contact form.', 'contact-form-7' ),
array( 'type' => 'warning' )
);
}
}