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


PHP wpcf7_strip_quote_deep函数代码示例

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


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

示例1: wpcf7_strip_quote_deep

function wpcf7_strip_quote_deep($arr)
{
    if (is_string($arr)) {
        return wpcf7_strip_quote($arr);
    }
    if (is_array($arr)) {
        $result = array();
        foreach ($arr as $key => $text) {
            $result[$key] = wpcf7_strip_quote_deep($text);
        }
        return $result;
    }
}
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:13,代码来源:formatting.php

示例2: replace_tags_callback

 private function replace_tags_callback($matches, $html = false)
 {
     // allow [[foo]] syntax for escaping a tag
     if ($matches[1] == '[' && $matches[4] == ']') {
         return substr($matches[0], 1, -1);
     }
     $tag = $matches[0];
     $tagname = $matches[2];
     $values = $matches[3];
     if (!empty($values)) {
         preg_match_all('/"[^"]*"|\'[^\']*\'/', $values, $matches);
         $values = wpcf7_strip_quote_deep($matches[0]);
     }
     $do_not_heat = false;
     if (preg_match('/^_raw_(.+)$/', $tagname, $matches)) {
         $tagname = trim($matches[1]);
         $do_not_heat = true;
     }
     $format = '';
     if (preg_match('/^_format_(.+)$/', $tagname, $matches)) {
         $tagname = trim($matches[1]);
         $format = $values[0];
     }
     $submission = WPCF7_Submission::get_instance();
     $submitted = $submission ? $submission->get_posted_data($tagname) : null;
     if (null !== $submitted) {
         if ($do_not_heat) {
             $submitted = isset($_POST[$tagname]) ? $_POST[$tagname] : '';
         }
         $replaced = $submitted;
         if (!empty($format)) {
             $replaced = $this->format($replaced, $format);
         }
         $replaced = wpcf7_flat_join($replaced);
         if ($html) {
             $replaced = esc_html($replaced);
             $replaced = wptexturize($replaced);
         }
         $replaced = apply_filters('wpcf7_mail_tag_replaced', $replaced, $submitted, $html);
         $replaced = wp_unslash(trim($replaced));
         $this->replaced_tags[$tag] = $replaced;
         return $replaced;
     }
     $special = apply_filters('wpcf7_special_mail_tags', '', $tagname, $html);
     if (!empty($special)) {
         $this->replaced_tags[$tag] = $special;
         return $special;
     }
     return $tag;
 }
开发者ID:netmagik,项目名称:netmagik,代码行数:50,代码来源:mail.php

示例3: shortcode_parse_atts

 function shortcode_parse_atts($text)
 {
     $atts = array('options' => array(), 'values' => array());
     $text = preg_replace("/[\\x{00a0}\\x{200b}]+/u", " ", $text);
     $text = stripcslashes(trim($text));
     $pattern = '%^([-+*=0-9a-zA-Z:.!?#$&@_/|\\%\\s]*?)((?:\\s*"[^"]*"|\\s*\'[^\']*\')*)$%';
     if (preg_match($pattern, $text, $match)) {
         if (!empty($match[1])) {
             $atts['options'] = preg_split('/[\\s]+/', trim($match[1]));
         }
         if (!empty($match[2])) {
             preg_match_all('/"[^"]*"|\'[^\']*\'/', $match[2], $matched_values);
             $atts['values'] = wpcf7_strip_quote_deep($matched_values[0]);
         }
     } else {
         $atts = $text;
     }
     return $atts;
 }
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:19,代码来源:shortcodes.php

示例4: replace_mail_tags_with_minimum_input

 public function replace_mail_tags_with_minimum_input($matches)
 {
     // allow [[foo]] syntax for escaping a tag
     if ($matches[1] == '[' && $matches[4] == ']') {
         return substr($matches[0], 1, -1);
     }
     $tag = $matches[0];
     $tagname = $matches[2];
     $values = $matches[3];
     if (!empty($values)) {
         preg_match_all('/"[^"]*"|\'[^\']*\'/', $values, $matches);
         $values = wpcf7_strip_quote_deep($matches[0]);
     }
     $do_not_heat = false;
     if (preg_match('/^_raw_(.+)$/', $tagname, $matches)) {
         $tagname = trim($matches[1]);
         $do_not_heat = true;
     }
     $format = '';
     if (preg_match('/^_format_(.+)$/', $tagname, $matches)) {
         $tagname = trim($matches[1]);
         $format = $values[0];
     }
     $example_email = 'example@example.com';
     $example_text = 'example';
     $example_blank = '';
     $form_tags = $this->contact_form->form_scan_shortcode(array('name' => $tagname));
     if ($form_tags) {
         $form_tag = new WPCF7_Shortcode($form_tags[0]);
         $is_required = $form_tag->is_required() || 'radio' == $form_tag->type;
         if (!$is_required) {
             return $example_blank;
         }
         $is_selectable = in_array($form_tag->basetype, array('radio', 'checkbox', 'select'));
         if ($is_selectable) {
             if ($form_tag->pipes instanceof WPCF7_Pipes) {
                 if ($do_not_heat) {
                     $before_pipes = $form_tag->pipes->collect_befores();
                     $last_item = array_pop($before_pipes);
                 } else {
                     $after_pipes = $form_tag->pipes->collect_afters();
                     $last_item = array_pop($after_pipes);
                 }
             } else {
                 $last_item = array_pop($form_tag->values);
             }
             if ($last_item && wpcf7_is_mailbox_list($last_item)) {
                 return $example_email;
             } else {
                 return $example_text;
             }
         }
         if ('email' == $form_tag->basetype) {
             return $example_email;
         } else {
             return $example_text;
         }
     } else {
         $tagname = preg_replace('/^wpcf7\\./', '_', $tagname);
         // for back-compat
         if ('_post_author_email' == $tagname) {
             return $example_email;
         } elseif ('_' == substr($tagname, 0, 1)) {
             // maybe special mail tag
             return $example_text;
         }
     }
     return $tag;
 }
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:69,代码来源:config-validator.php


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