本文整理汇总了PHP中RGFormsModel::create_post方法的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel::create_post方法的具体用法?PHP RGFormsModel::create_post怎么用?PHP RGFormsModel::create_post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGFormsModel
的用法示例。
在下文中一共展示了RGFormsModel::create_post方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fulfill_order
public static function fulfill_order(&$entry, $transaction_id, $amount)
{
$config = self::get_config_by_entry($entry);
if (!$config) {
self::log_error("Order can't be fulfilled because feed wasn't found for form: {$entry["form_id"]}");
return;
}
$form = RGFormsModel::get_form_meta($entry["form_id"]);
if ($config["meta"]["delay_post"]) {
self::log_debug("Creating post.");
RGFormsModel::create_post($form, $entry);
}
if (isset($config["meta"]["delay_notifications"])) {
//sending delayed notifications
GFCommon::send_notifications($config["meta"]["selected_notifications"], $form, $entry, true, "form_submission");
} else {
//sending notifications using the legacy structure
if ($config["meta"]["delay_notification"]) {
self::log_debug("Sending admin notification.");
GFCommon::send_admin_notification($form, $entry);
}
if ($config["meta"]["delay_autoresponder"]) {
self::log_debug("Sending user notification.");
GFCommon::send_user_notification($form, $entry);
}
}
self::log_debug("Before gform_paypal_fulfillment.");
do_action("gform_paypal_fulfillment", $entry, $config, $transaction_id, $amount);
}
示例2: create_post
public static function create_post($form, &$lead)
{
$disable_post = apply_filters("gform_disable_post_creation_{$form["id"]}", apply_filters("gform_disable_post_creation", false, $form, $lead), $form, $lead);
//creates post if the form has any post fields
$post_id = !$disable_post ? RGFormsModel::create_post($form, $lead) : 0;
return $post_id;
}
示例3: fulfill_order
public static function fulfill_order(&$entry, $transaction_id, $amount)
{
$form = RGFormsModel::get_form_meta($entry["form_id"]);
$config = self::get_config($entry["form_id"]);
if ($config && $config["meta"]["delay_post"]) {
self::$log->LogDebug("Creating post.");
RGFormsModel::create_post($form, $entry);
}
if ($config && $config["meta"]["delay_notification"]) {
self::$log->LogDebug("Sending admin notification.");
GFCommon::send_admin_notification($form, $entry);
}
if ($config && $config["meta"]["delay_autoresponder"]) {
self::$log->LogDebug("Sending user notification.");
GFCommon::send_user_notification($form, $entry);
}
self::$log->LogDebug("Before gform_paypal_fulfillment.");
do_action("gform_paypal_fulfillment", $entry, $config, $transaction_id, $amount);
}
示例4: create_post
public static function create_post($form, &$lead)
{
$disable_post = gf_apply_filters('gform_disable_post_creation', $form['id'], false, $form, $lead);
$post_id = 0;
if (!$disable_post) {
//creates post if the form has any post fields
$post_id = RGFormsModel::create_post($form, $lead);
}
return $post_id;
}
示例5: fulfill_order
/**
* Fulfill order
*
* @param array $entry
*/
public function fulfill_order($entry)
{
$feed = get_pronamic_gf_pay_feed_by_entry_id(rgar($entry, 'id'));
if (null !== $feed) {
$this->maybe_update_user_role($entry, $feed);
$form = RGFormsModel::get_form_meta($entry['form_id']);
// Delay post creation
// @see https://github.com/gravityforms/gravityforms/blob/1.8.20.5/forms_model.php#L2383
// @see https://github.com/gravityforms/gravityformspaypal/blob/1.10.3/paypal.php#L2411-L2415
if ($feed->delay_post_creation) {
RGFormsModel::create_post($form, $entry);
}
// Delay Aweber
// @see https://github.com/gravityforms/gravityformsaweber/blob/1.4.2/aweber.php#L1167-L1197
if ($feed->delay_aweber_subscription && Pronamic_WP_Pay_Class::method_exists('GFAWeber', 'export')) {
call_user_func(array('GFAWeber', 'export'), $entry, $form, false);
// @since 1.3.0
// @see https://github.com/gravityforms/gravityformsaweber/blob/2.2.1/aweber.php#L48-L50
// @see https://github.com/gravityforms/gravityforms/blob/1.9.10.15/includes/addon/class-gf-feed-addon.php#L43
if (function_exists('gf_aweber')) {
$addon = gf_aweber();
if (method_exists($addon, 'maybe_process_feed')) {
$addon->maybe_process_feed($entry, $form);
}
}
}
// Delay Campaign Monitor
if ($feed->delay_campaignmonitor_subscription) {
// @see https://github.com/gravityforms/gravityformscampaignmonitor/blob/2.5.1/campaignmonitor.php#L1184
if (Pronamic_WP_Pay_Class::method_exists('GFCampaignMonitor', 'export')) {
call_user_func(array('GFCampaignMonitor', 'export'), $entry, $form, false);
}
// @since 1.3.0
// @see https://github.com/gravityforms/gravityformscampaignmonitor/blob/3.3.2/campaignmonitor.php#L48-L50
// @see https://github.com/gravityforms/gravityforms/blob/1.9.10.15/includes/addon/class-gf-feed-addon.php#L43
if (function_exists('gf_campaignmonitor')) {
$addon = gf_campaignmonitor();
if (method_exists($addon, 'maybe_process_feed')) {
$addon->maybe_process_feed($entry, $form);
}
}
}
// Delay Mailchimp
if ($feed->delay_mailchimp_subscription) {
// @see https://github.com/gravityforms/gravityformsmailchimp/blob/2.4.5/mailchimp.php#L1512
if (Pronamic_WP_Pay_Class::method_exists('GFMailChimp', 'export')) {
call_user_func(array('GFMailChimp', 'export'), $entry, $form, false);
}
// @since 1.3.0
// @see https://github.com/gravityforms/gravityformsmailchimp/blob/3.6.3/mailchimp.php#L48-L50
// @see https://github.com/gravityforms/gravityforms/blob/1.9.10.15/includes/addon/class-gf-feed-addon.php#L43
if (function_exists('gf_mailchimp')) {
$addon = gf_mailchimp();
if (method_exists($addon, 'maybe_process_feed')) {
$addon->maybe_process_feed($entry, $form);
}
}
}
// Delay Zapier
// @see https://github.com/gravityforms/gravityformszapier/blob/1.4.2/zapier.php#L469-L533
if ($feed->delay_zapier && Pronamic_WP_Pay_Class::method_exists('GFZapier', 'send_form_data_to_zapier')) {
call_user_func(array('GFZapier', 'send_form_data_to_zapier'), $entry, $form);
}
// Delay user registration
// @see https://github.com/gravityforms/gravityformsuserregistration/blob/2.0/userregistration.php#L2133
if ($feed->delay_user_registration && Pronamic_WP_Pay_Class::method_exists('GFUser', 'gf_create_user')) {
call_user_func(array('GFUser', 'gf_create_user'), $entry, $form, false);
}
// Delay notifications
// Determine if the feed has Gravity Form 1.7 Feed IDs
if ($feed->has_delayed_notifications()) {
// @see https://bitbucket.org/Pronamic/gravityforms/src/42773f75ad7ad9ac9c31ce149510ff825e4aa01f/common.php?at=1.7.8#cl-1512
GFCommon::send_notifications($feed->delay_notification_ids, $form, $entry, true, 'form_submission');
}
if ($feed->delay_admin_notification && Pronamic_WP_Pay_Class::method_exists('GFCommon', 'send_admin_notification')) {
// https://github.com/gravityforms/gravityforms/blob/1.8.9/common.php#L1265-L1270
GFCommon::send_admin_notification($form, $entry);
}
if ($feed->delay_user_notification && Pronamic_WP_Pay_Class::method_exists('GFCommon', 'send_user_notification')) {
// https://github.com/gravityforms/gravityforms/blob/1.8.9/common.php#L1258-L1263
GFCommon::send_user_notification($form, $entry);
}
}
// The Gravity Forms PayPal Add-On executes the 'gform_paypal_fulfillment' action
do_action('gform_ideal_fulfillment', $entry, $feed);
}
示例6: handle_submission
public static function handle_submission($form, &$lead, $ajax = false)
{
//insert submissing in DB
RGFormsModel::save_lead($form, $lead);
//reading lead that was just saved
$lead = RGFormsModel::get_lead($lead["id"]);
$disable_post = apply_filters("gform_disable_post_creation_{$form["id"]}", apply_filters("gform_disable_post_creation", false, $form, $lead), $form, $lead);
if (!$disable_post) {
//creates post if the form has any post fields
$post_id = RGFormsModel::create_post($form, $lead);
}
//send auto-responder and notification emails
self::send_emails($form, $lead);
//display confirmation message or redirect to confirmation page
return self::handle_confirmation($form, $lead, $ajax);
}
示例7: fulfill_order
public static function fulfill_order(&$entry, $transaction_id, $amount)
{
$form = RGFormsModel::get_form_meta($entry["form_id"]);
$config = self::get_config($entry["form_id"]);
if ($config && $config["meta"]["delay_post"]) {
RGFormsModel::create_post($form, $entry);
}
if ($config && $config["meta"]["delay_notification"]) {
GFCommon::send_admin_notification($form, $entry);
}
if ($config && $config["meta"]["delay_autoresponder"]) {
GFCommon::send_user_notification($form, $entry);
}
do_action("gform_paypal_fulfillment", $entry, $config, $transaction_id, $amount);
}
示例8: fulfill_order
public static function fulfill_order($entry, $transaction_id, $initial_payment_amount, $subscription_amount)
{
$form = RGFormsModel::get_form_meta($entry["form_id"]);
$config = self::get_config_by_entry($entry["id"]);
if ($config) {
self::log_debug("Creating post.");
RGFormsModel::create_post($form, $entry);
self::log_debug("Post created.");
self::log_debug("Sending admin notification.");
GFCommon::send_admin_notification($form, $entry);
self::log_debug("Sending user notification.");
GFCommon::send_user_notification($form, $entry);
}
do_action("gform_paypalpro_fulfillment", $entry, $config, $transaction_id, $initial_payment_amount, $subscription_amount);
}