wpcf7_get_contact_form_by_title()CF7 1.0

Searches for a contact form by title.

Хуков нет.

Возвращает

WPCF7_ContactForm|null. Contact form object if found, null otherwise.

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

wpcf7_get_contact_form_by_title( $title );
$title(строка) (обязательный)
Title of contact form.

Код wpcf7_get_contact_form_by_title() CF7 5.6.2

function wpcf7_get_contact_form_by_title( $title ) {
	$page = get_page_by_title( $title, OBJECT, WPCF7_ContactForm::post_type );

	if ( $page ) {
		return wpcf7_contact_form( $page->ID );
	}

	return null;
}