本文整理匯總了PHP中WPCF7_ContactForm::upgrade方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPCF7_ContactForm::upgrade方法的具體用法?PHP WPCF7_ContactForm::upgrade怎麽用?PHP WPCF7_ContactForm::upgrade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WPCF7_ContactForm
的用法示例。
在下文中一共展示了WPCF7_ContactForm::upgrade方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wpcf7_contact_form
function wpcf7_contact_form($id)
{
global $wpdb;
$table_name = wpcf7_table_name();
$id = (int) $id;
$query = $wpdb->prepare("SELECT * FROM {$table_name} WHERE cf7_unit_id = %d", $id);
if (!($row = $wpdb->get_row($query))) {
return false;
}
// No data
$contact_form = new WPCF7_ContactForm();
$contact_form->id = $row->cf7_unit_id;
$contact_form->title = stripslashes_deep($row->title);
$contact_form->form = stripslashes_deep(maybe_unserialize($row->form));
$contact_form->mail = stripslashes_deep(maybe_unserialize($row->mail));
$contact_form->mail_2 = stripslashes_deep(maybe_unserialize($row->mail_2));
$contact_form->messages = stripslashes_deep(maybe_unserialize($row->messages));
$contact_form->additional_settings = stripslashes_deep(maybe_unserialize($row->additional_settings));
$contact_form->upgrade();
return $contact_form;
}
示例2: wpcf7_contact_form
function wpcf7_contact_form($id)
{
$post = get_post($id);
if (empty($post) || 'wpcf7_contact_form' != get_post_type($post)) {
return false;
}
$contact_form = new WPCF7_ContactForm();
$contact_form->id = $post->ID;
$contact_form->title = $post->post_title;
$contact_form->form = get_post_meta($post->ID, 'form', true);
$contact_form->mail = get_post_meta($post->ID, 'mail', true);
$contact_form->mail_2 = get_post_meta($post->ID, 'mail_2', true);
$contact_form->messages = get_post_meta($post->ID, 'messages', true);
$contact_form->additional_settings = get_post_meta($post->ID, 'additional_settings', true);
$contact_form->upgrade();
$contact_form = apply_filters_ref_array('wpcf7_contact_form', array(&$contact_form));
return $contact_form;
}
示例3: wpcf7_contact_form
function wpcf7_contact_form($id)
{
global $wpdb, $wpcf7;
$query = $wpdb->prepare("SELECT * FROM {$wpcf7->contactforms} WHERE cf7_unit_id = %d", $id);
if (!($row = $wpdb->get_row($query))) {
return false;
}
// No data
$contact_form = new WPCF7_ContactForm();
$contact_form->id = $row->cf7_unit_id;
$contact_form->title = maybe_unserialize($row->title);
$contact_form->form = maybe_unserialize($row->form);
$contact_form->mail = maybe_unserialize($row->mail);
$contact_form->mail_2 = maybe_unserialize($row->mail_2);
$contact_form->messages = maybe_unserialize($row->messages);
$contact_form->additional_settings = maybe_unserialize($row->additional_settings);
$contact_form->upgrade();
return $contact_form;
}