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


PHP ShortcodeHelper::clean_up_shortcode方法代码示例

本文整理汇总了PHP中ShortcodeHelper::clean_up_shortcode方法的典型用法代码示例。如果您正苦于以下问题:PHP ShortcodeHelper::clean_up_shortcode方法的具体用法?PHP ShortcodeHelper::clean_up_shortcode怎么用?PHP ShortcodeHelper::clean_up_shortcode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShortcodeHelper的用法示例。


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

示例1: meta_box_save

 /**
  *set status of builder (open/closed) and save the shortcodes that are used in the post
  **/
 public function meta_box_save()
 {
     if (isset($_POST['post_ID'])) {
         //save if the editor is active
         if (isset($_POST['aviaLayoutBuilder_active'])) {
             update_post_meta((int) $_POST['post_ID'], '_aviaLayoutBuilder_active', $_POST['aviaLayoutBuilder_active']);
             $_POST['content'] = ShortcodeHelper::clean_up_shortcode($_POST['content']);
         }
         //save the hidden container with unmodified shortcode
         if (isset($_POST['_aviaLayoutBuilderCleanData'])) {
             update_post_meta((int) $_POST['post_ID'], '_aviaLayoutBuilderCleanData', $_POST['_aviaLayoutBuilderCleanData']);
         }
         //extract all shortcodes from the post array and store them so we know what we are dealing with when the user opens a page.
         //usesfull for special elements that we might need to render outside of the default loop like fullscreen slideshows
         preg_match_all("/" . ShortcodeHelper::get_fake_pattern() . "/s", $_POST['content'], $matches);
         if (is_array($matches) && !empty($matches[0])) {
             $matches = ShortcodeHelper::build_shortcode_tree($matches);
             update_post_meta((int) $_POST['post_ID'], '_avia_builder_shortcode_tree', $matches);
         }
     }
 }
开发者ID:DylanPeti,项目名称:socialize,代码行数:24,代码来源:template-builder.class.php

示例2: save_builder_template

 /**
  * Ajax Function that checks if template can be saved
  *
  */
 public function save_builder_template($name = "%", $value = "")
 {
     check_ajax_referer('avia_nonce_save', 'avia-save-nonce');
     $name = isset($_POST['templateName']) ? $_POST['templateName'] : $name;
     $value = isset($_POST['templateValue']) ? $_POST['templateValue'] : $value;
     $id = AviaStoragePost::get_custom_post('template_builder_snippets');
     $key = $this->generate_key($name);
     $old = $this->get_meta_values($key);
     if (!empty($old)) {
         echo __('Template name already in use. Please delete the template with this name first or choose a different name', 'avia_framework');
     } else {
         $value = ShortcodeHelper::clean_up_shortcode($value);
         $result = update_post_meta($id, $key, '{{{' . $name . '}}}' . $value);
         echo 'avia_template_saved';
     }
     die;
 }
开发者ID:bluedrone,项目名称:plugins,代码行数:21,代码来源:save-buildertemplate.class.php


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