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


PHP GFAPI::add_feed方法代码示例

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


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

示例1: post_feeds

 public function post_feeds($feeds, $form_id = null)
 {
     $this->authorize("gravityforms_edit_forms");
     $feed_ids = array();
     $result = array();
     foreach ($feeds as $feed) {
         $addon_slug = isset($feed["addon_slug"]) ? $feed["addon_slug"] : rgget("addon");
         $f_id = empty($form_id) ? $feed["form_id"] : $form_id;
         if (empty($f_id)) {
             $result = new WP_Error("missing_form_id", __("Missing form id", "gravityforms"));
             break;
         }
         $result = GFAPI::add_feed($f_id, $feed["meta"], $addon_slug);
         if (is_wp_error($result)) {
             break;
         }
         $feed_ids[] = $result;
     }
     if (is_wp_error($result)) {
         $response = $this->get_error_response($result);
         $status = $this->get_error_status($result);
     } else {
         $status = 201;
         $response = $feed_ids;
     }
     $this->end($status, $response);
 }
开发者ID:tlandn,项目名称:akvo-web,代码行数:27,代码来源:webapi.php

示例2: add_step

 /**
  * Adds a Workflow step to the form with the given settings. The following settings are required:
  * - step_name (string)
  * - step_type (string)
  * - description (string)
  *
  * @param $step_settings
  *
  * @return mixed
  */
 public function add_step($step_settings)
 {
     return GFAPI::add_feed($this->form_id, $step_settings, 'gravityflow');
 }
开发者ID:jakejackson1,项目名称:gravityflow,代码行数:14,代码来源:class-api.php

示例3: post_feeds

 public function post_feeds($feeds, $form_id = null)
 {
     $this->log_debug(__METHOD__ . '(): Running.');
     $capability = apply_filters('gform_web_api_capability_post_feeds', 'gravityforms_edit_forms');
     $this->authorize($capability);
     $feed_ids = array();
     $result = array();
     foreach ($feeds as $feed) {
         $addon_slug = isset($feed['addon_slug']) ? $feed['addon_slug'] : rgget('addon');
         $f_id = empty($form_id) ? $feed['form_id'] : $form_id;
         if (empty($f_id)) {
             $result = new WP_Error('missing_form_id', __('Missing form id', 'gravityforms'));
             break;
         }
         $result = GFAPI::add_feed($f_id, $feed['meta'], $addon_slug);
         if (is_wp_error($result)) {
             break;
         }
         $feed_ids[] = $result;
     }
     if (is_wp_error($result)) {
         $response = $this->get_error_response($result);
         $status = $this->get_error_status($result);
     } else {
         $status = 201;
         $response = $feed_ids;
     }
     $this->end($status, $response);
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:29,代码来源:webapi.php

示例4: import_gravityflow_feeds

 public function import_gravityflow_feeds($original_feeds, $new_form_id)
 {
     $feed_id_mappings = array();
     foreach ($original_feeds as $feed) {
         $new_feed_id = GFAPI::add_feed($new_form_id, $feed['meta'], 'gravityflow');
         if (!$feed['is_active']) {
             $this->update_feed_active($new_feed_id, false);
         }
         $feed_id_mappings[$feed['id']] = $new_feed_id;
     }
     $new_steps = $this->get_steps($new_form_id);
     foreach ($new_steps as $new_step) {
         $statuses_configs = $new_step->get_status_config();
         $new_step_meta = $new_step->get_feed_meta();
         $step_ids_updated = false;
         foreach ($statuses_configs as $status_config) {
             $destination_key = 'destination_' . $status_config['status'];
             $old_destination_step_id = $new_step_meta[$destination_key];
             if (!in_array($old_destination_step_id, array('next', 'complete')) && isset($feed_id_mappings[$old_destination_step_id])) {
                 $new_step_meta[$destination_key] = $feed_id_mappings[$old_destination_step_id];
                 $step_ids_updated = true;
             }
         }
         if ($new_step->get_type() == 'approval') {
             if (!empty($new_step->revert_buttonValue)) {
                 $new_step_meta['revert_buttonValue'] = $feed_id_mappings[$new_step->revert_buttonValue];
             }
         }
         if ($step_ids_updated) {
             $this->update_feed_meta($new_step->get_id(), $new_step_meta);
         }
     }
 }
开发者ID:jakejackson1,项目名称:gravityflow,代码行数:33,代码来源:class-gravity-flow.php


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