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


PHP FrmAppHelper::prepare_and_encode方法代码示例

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


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

示例1: migrate_email_settings_to_action

 private static function migrate_email_settings_to_action($form_options, $form_id, $post_type, &$imported, $switch)
 {
     // No old notifications or autoresponders to carry over
     if (!isset($form_options['auto_responder']) && !isset($form_options['notification']) && !isset($form_options['email_to'])) {
         return;
     }
     // Initialize notifications array
     $notifications = array();
     // Migrate regular notifications
     self::migrate_notifications_to_action($form_options, $form_id, $notifications);
     // Migrate autoresponders
     self::migrate_autoresponder_to_action($form_options, $form_id, $notifications);
     if (empty($notifications)) {
         return;
     }
     foreach ($notifications as $new_notification) {
         $new_notification['post_type'] = $post_type;
         $new_notification['post_excerpt'] = 'email';
         $new_notification['post_title'] = __('Email Notification', 'formidable');
         $new_notification['menu_order'] = $form_id;
         $new_notification['post_status'] = 'publish';
         // Switch field IDs and keys, if needed
         if ($switch) {
             // Switch field IDs in email conditional logic
             self::switch_email_contition_field_ids($new_notification['post_content']);
             // Switch all other field IDs in email
             $new_notification['post_content'] = FrmFieldsHelper::switch_field_ids($new_notification['post_content']);
         }
         $new_notification['post_content'] = FrmAppHelper::prepare_and_encode($new_notification['post_content']);
         $exists = get_posts(array('name' => $new_notification['post_name'], 'post_type' => $new_notification['post_type'], 'post_status' => $new_notification['post_status'], 'numberposts' => 1));
         if (empty($exists)) {
             FrmAppHelper::save_json_post($new_notification);
             $imported['imported']['actions']++;
         }
         unset($new_notification);
     }
 }
开发者ID:EyesX,项目名称:formidable-forms,代码行数:37,代码来源:FrmXMLHelper.php

示例2: save_settings

 /**
  * Prepare and save settings in styles and actions
  *
  * @param array $settings
  * @param string $group
  *
  * @since 2.0.6
  */
 public static function save_settings($settings, $group)
 {
     $settings = (array) $settings;
     $settings['post_content'] = FrmAppHelper::prepare_and_encode($settings['post_content']);
     if (empty($settings['ID'])) {
         unset($settings['ID']);
     }
     // delete all caches for this group
     self::cache_delete_group($group);
     return self::save_json_post($settings);
 }
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:19,代码来源:FrmAppHelper.php


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