当前位置: 首页>>代码示例>>PHP>>正文


PHP wpcf7_get_request_uri函数代码示例

本文整理汇总了PHP中wpcf7_get_request_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP wpcf7_get_request_uri函数的具体用法?PHP wpcf7_get_request_uri怎么用?PHP wpcf7_get_request_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wpcf7_get_request_uri函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: form_html

 function form_html()
 {
     $form = '<div class="wpcf7" id="' . $this->unit_tag . '">';
     $url = wpcf7_get_request_uri();
     if ($frag = strstr($url, '#')) {
         $url = substr($url, 0, -strlen($frag));
     }
     $url .= '#' . $this->unit_tag;
     $url = apply_filters('wpcf7_form_action_url', $url);
     $enctype = apply_filters('wpcf7_form_enctype', '');
     $class = apply_filters('wpcf7_form_class_attr', 'wpcf7-form');
     $form .= '<form action="' . esc_url_raw($url) . '" method="post"' . ' class="' . esc_attr($class) . '"' . $enctype . '>' . "\n";
     $form .= '<div style="display: none;">' . "\n";
     $form .= '<input type="hidden" name="_wpcf7" value="' . esc_attr($this->id) . '" />' . "\n";
     $form .= '<input type="hidden" name="_wpcf7_version" value="' . esc_attr(WPCF7_VERSION) . '" />' . "\n";
     $form .= '<input type="hidden" name="_wpcf7_unit_tag" value="' . esc_attr($this->unit_tag) . '" />' . "\n";
     $form .= '</div>' . "\n";
     $form .= $this->form_elements();
     if (!$this->responses_count) {
         $form .= $this->form_response_output();
     }
     $form .= '</form>';
     $form .= '</div>';
     return $form;
 }
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:25,代码来源:classes.php

示例2: form_html

 function form_html()
 {
     $form = '<div class="wpcf7" id="' . $this->unit_tag . '">';
     $url = wpcf7_get_request_uri();
     if ($frag = strstr($url, '#')) {
         $url = substr($url, 0, -strlen($frag));
     }
     $url .= '#' . $this->unit_tag;
     $url = apply_filters('wpcf7_form_action_url', $url);
     $class = 'wpcf7-form';
     if ($this->is_posted()) {
         if (!empty($_POST['_wpcf7_validation_errors'])) {
             $class .= ' invalid';
         } elseif (!empty($_POST['_wpcf7_mail_sent'])) {
             if (!empty($_POST['_wpcf7_mail_sent']['spam'])) {
                 $class .= ' spam';
             } elseif (!empty($_POST['_wpcf7_mail_sent']['ok'])) {
                 $class .= ' sent';
             } else {
                 $class .= ' failed';
             }
         }
     }
     $class = apply_filters('wpcf7_form_class_attr', $class);
     $enctype = apply_filters('wpcf7_form_enctype', '');
     $form .= '<form action="' . esc_url_raw($url) . '" method="post"' . ' class="' . esc_attr($class) . '"' . $enctype . '>' . "\n";
     $form .= $this->form_hidden_fields();
     $form .= $this->form_elements();
     if (!$this->responses_count) {
         $form .= $this->form_response_output();
     }
     $form .= '</form>';
     $form .= '</div>';
     return $form;
 }
开发者ID:rotoballer,项目名称:emily,代码行数:35,代码来源:classes.php

示例3: wpcf7_special_mail_tag

function wpcf7_special_mail_tag($output, $name)
{
    // For backwards compat.
    $name = preg_replace('/^wpcf7\\./', '_', $name);
    if ('_remote_ip' == $name) {
        $output = preg_replace('/[^0-9a-f.:, ]/', '', $_SERVER['REMOTE_ADDR']);
    } elseif ('_url' == $name) {
        $output = get_option('home') . wpcf7_get_request_uri();
    } elseif ('_date' == $name) {
        $output = date_i18n(get_option('date_format'));
    } elseif ('_time' == $name) {
        $output = date_i18n(get_option('time_format'));
    }
    return $output;
}
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:15,代码来源:special-mail-tags.php

示例4: wpcf7_special_mail_tag

function wpcf7_special_mail_tag($output, $name)
{
    // For backwards compat.
    $name = preg_replace('/^wpcf7\\./', '_', $name);
    if ('_remote_ip' == $name) {
        $output = preg_replace('/[^0-9a-f.:, ]/', '', $_SERVER['REMOTE_ADDR']);
    } elseif ('_url' == $name) {
        $url = untrailingslashit(home_url());
        $url = preg_replace('%(?<!:|/)/.*$%', '', $url);
        $url .= wpcf7_get_request_uri();
        $output = esc_url($url);
    } elseif ('_date' == $name) {
        $output = date_i18n(get_option('date_format'));
    } elseif ('_time' == $name) {
        $output = date_i18n(get_option('time_format'));
    }
    return $output;
}
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:18,代码来源:special-mail-tags.php

示例5: form_html

 function form_html()
 {
     $form = '<div class="wpcf7" id="' . $this->unit_tag . '">';
     $url = wpcf7_get_request_uri();
     if ($frag = strstr($url, '#')) {
         $url = substr($url, 0, -strlen($frag));
     }
     $url .= '#' . $this->unit_tag;
     $url = apply_filters('wpcf7_form_action_url', $url);
     $enctype = apply_filters('wpcf7_form_enctype', '');
     $class = apply_filters('wpcf7_form_class_attr', 'wpcf7-form');
     $form .= '<form action="' . esc_url_raw($url) . '" method="post"' . ' class="' . esc_attr($class) . '"' . $enctype . '>' . "\n";
     $form .= $this->form_hidden_fields();
     $form .= $this->form_elements();
     if (!$this->responses_count) {
         $form .= $this->form_response_output();
     }
     $form .= '</form>';
     $form .= '</div>';
     return $form;
 }
开发者ID:xuandungpy,项目名称:vuong,代码行数:21,代码来源:classes.php

示例6: form_html

 public function form_html($args = '')
 {
     $args = wp_parse_args($args, array('html_id' => '', 'html_name' => '', 'html_class' => '', 'output' => 'form'));
     if ('raw_form' == $args['output']) {
         return '<pre class="wpcf7-raw-form"><code>' . esc_html($this->prop('form')) . '</code></pre>';
     }
     $this->unit_tag = self::get_unit_tag($this->id);
     $html = sprintf('<div %s>', wpcf7_format_atts(array('role' => 'form', 'class' => 'wpcf7', 'id' => $this->unit_tag, get_option('html_type') == 'text/html' ? 'lang' : 'xml:lang' => str_replace('_', '-', $this->locale), 'dir' => wpcf7_is_rtl($this->locale) ? 'rtl' : 'ltr'))) . "\n";
     $html .= $this->screen_reader_response() . "\n";
     $url = wpcf7_get_request_uri();
     if ($frag = strstr($url, '#')) {
         $url = substr($url, 0, -strlen($frag));
     }
     $url .= '#' . $this->unit_tag;
     $url = apply_filters('wpcf7_form_action_url', $url);
     $id_attr = apply_filters('wpcf7_form_id_attr', preg_replace('/[^A-Za-z0-9:._-]/', '', $args['html_id']));
     $name_attr = apply_filters('wpcf7_form_name_attr', preg_replace('/[^A-Za-z0-9:._-]/', '', $args['html_name']));
     $class = 'wpcf7-form';
     if ($this->is_posted()) {
         $submission = WPCF7_Submission::get_instance();
         if ($submission->is('validation_failed')) {
             $class .= ' invalid';
         } elseif ($submission->is('spam')) {
             $class .= ' spam';
         } elseif ($submission->is('mail_sent')) {
             $class .= ' sent';
         } elseif ($submission->is('mail_failed')) {
             $class .= ' failed';
         }
     }
     if ($args['html_class']) {
         $class .= ' ' . $args['html_class'];
     }
     if ($this->in_demo_mode()) {
         $class .= ' demo';
     }
     $class = explode(' ', $class);
     $class = array_map('sanitize_html_class', $class);
     $class = array_filter($class);
     $class = array_unique($class);
     $class = implode(' ', $class);
     $class = apply_filters('wpcf7_form_class_attr', $class);
     $enctype = apply_filters('wpcf7_form_enctype', '');
     $novalidate = apply_filters('wpcf7_form_novalidate', wpcf7_support_html5());
     $atts = array('action' => esc_url($url), 'method' => 'post', 'class' => $class, 'enctype' => wpcf7_enctype_value($enctype), 'novalidate' => $novalidate ? 'novalidate' : '');
     if ('' !== $id_attr) {
         $atts['id'] = $id_attr;
     }
     if ('' !== $name_attr) {
         $atts['name'] = $name_attr;
     }
     $atts = wpcf7_format_atts($atts);
     $html .= sprintf('<form %s>', $atts) . "\n";
     $html .= $this->form_hidden_fields();
     $html .= $this->form_elements();
     if (!$this->responses_count) {
         $html .= $this->form_response_output();
     }
     $html .= '</form>';
     $html .= '</div>';
     return $html;
 }
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:62,代码来源:contact-form.php

示例7: wpcf7_init

function wpcf7_init()
{
    wpcf7_get_request_uri();
    wpcf7_register_post_types();
    do_action('wpcf7_init');
}
开发者ID:SpatialMetabolomics,项目名称:metaspace-website,代码行数:6,代码来源:settings.php

示例8: submit

 private function submit()
 {
     if (!$this->is('init')) {
         return $this->status;
     }
     $this->meta = array('remote_ip' => isset($_SERVER['REMOTE_ADDR']) ? preg_replace('/[^0-9a-f.:, ]/', '', $_SERVER['REMOTE_ADDR']) : '', 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 254) : '', 'url' => preg_replace('%(?<!:|/)/.*$%', '', untrailingslashit(home_url())) . wpcf7_get_request_uri(), 'timestamp' => current_time('timestamp'), 'unit_tag' => isset($_POST['_wpcf7_unit_tag']) ? $_POST['_wpcf7_unit_tag'] : '');
     $contact_form = $this->contact_form;
     if (!$this->validate()) {
         // Validation error occured
         $this->status = 'validation_failed';
         $this->response = $contact_form->message('validation_error');
     } elseif (!$this->accepted()) {
         // Not accepted terms
         $this->status = 'acceptance_missing';
         $this->response = $contact_form->message('accept_terms');
     } elseif ($this->spam()) {
         // Spam!
         $this->status = 'spam';
         $this->response = $contact_form->message('spam');
     } elseif ($this->mail()) {
         $this->status = 'mail_sent';
         $this->response = $contact_form->message('mail_sent_ok');
         do_action('wpcf7_mail_sent', $contact_form);
     } else {
         $this->status = 'mail_failed';
         $this->response = $contact_form->message('mail_sent_ng');
         do_action('wpcf7_mail_failed', $contact_form);
     }
     $this->remove_uploaded_files();
     return $this->status;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:31,代码来源:submission.php

示例9: form_html

 public function form_html($atts = array())
 {
     $atts = wp_parse_args($atts, array('html_id' => '', 'html_class' => ''));
     $this->unit_tag = self::get_unit_tag($this->id);
     $form = '<div class="wpcf7" id="' . $this->unit_tag . '">';
     $url = wpcf7_get_request_uri();
     if ($frag = strstr($url, '#')) {
         $url = substr($url, 0, -strlen($frag));
     }
     $url .= '#' . $this->unit_tag;
     $url = apply_filters('wpcf7_form_action_url', $url);
     $id_attr = apply_filters('wpcf7_form_id_attr', preg_replace('/[^A-Za-z0-9:._-]/', '', $atts['html_id']));
     $class = 'wpcf7-form';
     $result = self::get_submission_status($this->id);
     if ($this->is_posted()) {
         if (empty($result['valid'])) {
             $class .= ' invalid';
         } elseif (!empty($result['spam'])) {
             $class .= ' spam';
         } elseif (!empty($result['mail_sent'])) {
             $class .= ' sent';
         } else {
             $class .= ' failed';
         }
     }
     $atts['html_class'] = array_unique(array_map('sanitize_html_class', explode(' ', $atts['html_class'])));
     if ($atts['html_class']) {
         $class .= ' ' . implode(' ', $atts['html_class']);
     }
     $class = apply_filters('wpcf7_form_class_attr', trim($class));
     $enctype = apply_filters('wpcf7_form_enctype', '');
     $novalidate = apply_filters('wpcf7_form_novalidate', wpcf7_support_html5() ? ' novalidate="novalidate"' : '');
     $form .= '<form action="' . esc_url_raw($url) . '" method="post"' . ($id_attr ? ' id="' . esc_attr($id_attr) . '"' : '') . ' class="' . esc_attr($class) . '"' . $enctype . $novalidate . '>' . "\n";
     $form .= $this->form_hidden_fields();
     $form .= $this->form_elements();
     if (!$this->responses_count) {
         $form .= $this->form_response_output();
     }
     $form .= '</form>';
     $form .= '</div>';
     return $form;
 }
开发者ID:byronmisiva,项目名称:msv-dev,代码行数:42,代码来源:classes.php


注:本文中的wpcf7_get_request_uri函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。