本文整理匯總了PHP中WPCF7_ContactForm::id方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPCF7_ContactForm::id方法的具體用法?PHP WPCF7_ContactForm::id怎麽用?PHP WPCF7_ContactForm::id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WPCF7_ContactForm
的用法示例。
在下文中一共展示了WPCF7_ContactForm::id方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: process
/**
* Subscribe from Contact Form 7 Forms
*
* @todo improve smart guessing based on selected MailChimp lists
*
* @param WPCF7_ContactForm $cf7_form
* @return bool
*/
public function process($cf7_form)
{
// was sign-up checkbox checked?
if (!$this->checkbox_was_checked()) {
return false;
}
$parser = new MC4WP_Field_Guesser($this->get_data());
$data = $parser->combine(array('guessed', 'namespaced'));
// do nothing if no email was found
if (empty($data['EMAIL'])) {
return false;
}
return $this->subscribe($data['EMAIL'], $data, $cf7_form->id());
}
示例2: __construct
public function __construct(WPCF7_ContactForm $contact_form)
{
$this->contact_form = $contact_form;
$config_errors = get_post_meta($contact_form->id(), '_config_errors', true);
foreach ((array) $config_errors as $section => $errors) {
if (empty($errors)) {
continue;
}
if (!is_array($errors)) {
// for back-compat
$code = $errors;
$this->add_error($section, $code);
} else {
foreach ((array) $errors as $error) {
if (!empty($error['code'])) {
$code = $error['code'];
$args = isset($error['args']) ? $error['args'] : '';
$this->add_error($section, $code, $args);
}
}
}
}
}
示例3: track_cf7_submission
/**
* PHPDOC
*
* @param WPCF7_ContactForm $form PHPDOC
* @param array $result PHPDOC
*
* @return void
*
* @since PHPDOC
*/
public function track_cf7_submission($form, $result)
{
$status = $result['status'];
$type = NelioABAction::SUBMIT_CF7_FORM;
if ($status == 'mail_sent' || $status == 'demo_mode') {
$this->send_form_action_if_required($type, $form->id());
}
}