: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'wpcf7-integration', wpcf7_current_action(), $service
do_action( 'wpcf7_admin_notices',
'wpcf7-integration', wpcf7_current_action(), $service
$message = $_REQUEST['message'] ?? '';
$service->admin_notice( $message );
$integration->list_services( array(
'include' => $_REQUEST['service'],
$integration->list_services();
add_action( 'wpcf7_admin_notices', 'wpcf7_admin_updated_message', 10, 3 );
function wpcf7_admin_updated_message( $page, $action, $object ) {
if ( ! in_array( $page, array( 'wpcf7', 'wpcf7-new' ) ) ) {
if ( empty( $_REQUEST['message'] ) ) {
if ( 'created' === $_REQUEST['message'] ) {
$updated_message = __( "Contact form created.", 'contact-form-7' );
} elseif ( 'saved' === $_REQUEST['message'] ) {
$updated_message = __( "Contact form saved.", 'contact-form-7' );
} elseif ( 'deleted' === $_REQUEST['message'] ) {
$updated_message = __( "Contact form deleted.", 'contact-form-7' );
if ( ! empty( $updated_message ) ) {
'<div id="message" class="notice notice-success"><p>%s</p></div>',
esc_html( $updated_message )
if ( 'failed' === $_REQUEST['message'] ) {
__( "There was an error saving the contact form.", 'contact-form-7' );
'<div id="message" class="notice notice-error"><p>%s</p></div>',
esc_html( $updated_message )
if ( 'validated' === $_REQUEST['message'] ) {
$bulk_validate = WPCF7::get_option( 'bulk_validate', array() );
$count_invalid = isset( $bulk_validate['count_invalid'] )
? absint( $bulk_validate['count_invalid'] ) : 0;
$updated_message = sprintf(
/* translators: %s: number of contact forms */
"Configuration validation completed. %s invalid contact form was found.",
"Configuration validation completed. %s invalid contact forms were found.",
$count_invalid, 'contact-form-7'
number_format_i18n( $count_invalid )
'<div id="message" class="notice notice-warning"><p>%s</p></div>',
esc_html( $updated_message )
$updated_message = __( "Configuration validation completed. No invalid contact form was found.", 'contact-form-7' );
'<div id="message" class="notice notice-success"><p>%s</p></div>',
esc_html( $updated_message )
add_filter( 'plugin_action_links', 'wpcf7_plugin_action_links', 10, 2 );
function wpcf7_plugin_action_links( $links, $file ) {
if ( $file != WPCF7_PLUGIN_BASENAME ) {
if ( ! current_user_can( 'wpcf7_read_contact_forms' ) ) {
$settings_link = wpcf7_link(
menu_page_url( 'wpcf7', false ),
__( 'Settings', 'contact-form-7' )
array_unshift( $links, $settings_link );
add_action( 'wpcf7_admin_warnings', 'wpcf7_old_wp_version_error', 10, 3 );
function wpcf7_old_wp_version_error( $page, $action, $object ) {
$wp_version = get_bloginfo( 'version' );
if ( ! version_compare( $wp_version, WPCF7_REQUIRED_WP_VERSION, '<' ) ) {
<div class="notice notice-warning">
/* translators: 1: version of Contact Form 7, 2: version of WordPress, 3: URL */
__( '<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href="%3$s">update WordPress</a> first.', 'contact-form-7' ),
WPCF7_REQUIRED_WP_VERSION,
admin_url( 'update-core.php' )
add_action( 'wpcf7_admin_warnings', 'wpcf7_not_allowed_to_edit', 10, 3 );
function wpcf7_not_allowed_to_edit( $page, $action, $object ) {
if ( $object instanceof WPCF7_ContactForm ) {
if ( current_user_can( 'wpcf7_edit_contact_form', $contact_form->id() ) ) {
$message = __( "You are not allowed to edit this contact form.", 'contact-form-7' );
'<div class="notice notice-warning"><p>%s</p></div>',
add_action( 'wpcf7_admin_warnings', 'wpcf7_outdated_php_warning', 10, 3 );
function wpcf7_outdated_php_warning( $page, $action, $object ) {
if ( ! version_compare( PHP_VERSION, '7.4', '<' ) ) {
$message = __( "The next major release of Contact Form 7 will discontinue support for outdated PHP versions. If you don't upgrade PHP, you will not be able to upgrade the plugin.", 'contact-form-7' );
'<div class="notice notice-warning"><p>%s</p></div>',
add_action( 'wpcf7_admin_warnings', 'wpcf7_ctct_deprecated_warning', 10, 3 );
function wpcf7_ctct_deprecated_warning( $page, $action, $object ) {
$service = WPCF7_ConstantContact::get_instance();
if ( ! $service->is_active() ) {
$message = __( "The Constant Contact integration is deprecated. It is not recommended to continue using the feature.", 'contact-form-7' );
'<div class="notice notice-warning"><p>%s</p></div>',