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