本文整理汇总了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;
}