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


PHP GFCommon::akismet_enabled方法代码示例

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


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

示例1: leads_page


//.........这里部分代码省略.........
                                ?>
" title="Mark this entry as read" href="javascript:ToggleRead('<?php 
                                echo esc_js($lead['id']);
                                ?>
', '<?php 
                                echo esc_js($filter);
                                ?>
');" style="display:<?php 
                                echo $lead['is_read'] ? 'none' : 'inline';
                                ?>
;"><?php 
                                esc_html_e('Mark read', 'gravityforms');
                                ?>
</a><a id="mark_unread_<?php 
                                echo absint($lead['id']);
                                ?>
" title="<?php 
                                esc_attr_e('Mark this entry as unread', 'gravityforms');
                                ?>
" href="javascript:ToggleRead('<?php 
                                echo esc_js($lead['id']);
                                ?>
', '<?php 
                                echo esc_js($filter);
                                ?>
');" style="display:<?php 
                                echo $lead['is_read'] ? 'inline' : 'none';
                                ?>
;"><?php 
                                esc_html_e('Mark unread', 'gravityforms');
                                ?>
</a>
											<?php 
                                echo GFCommon::current_user_can_any('gravityforms_delete_entries') || GFCommon::akismet_enabled($form_id) ? '|' : '';
                                ?>
                                            </span>
										<?php 
                                if (GFCommon::spam_enabled($form_id)) {
                                    ?>
											<span class="spam">
                                                <a data-wp-lists='delete:gf_entry_list:lead_row_<?php 
                                    echo esc_attr($lead['id']);
                                    ?>
::status=spam&entry=<?php 
                                    echo esc_attr($lead['id']);
                                    ?>
' title="<?php 
                                    esc_attr_e('Mark this entry as spam', 'gravityforms');
                                    ?>
" href="<?php 
                                    echo wp_nonce_url('?page=gf_entries', 'gf_delete_entry');
                                    ?>
"><?php 
                                    esc_html_e('Spam', 'gravityforms');
                                    ?>
</a>
												<?php 
                                    echo GFCommon::current_user_can_any('gravityforms_delete_entries') ? '|' : '';
                                    ?>
                                            </span>

										<?php 
                                }
                                if (GFCommon::current_user_can_any('gravityforms_delete_entries')) {
                                    ?>
											<span class="trash">
开发者ID:kidaak,项目名称:gravityforms,代码行数:67,代码来源:entry_list.php

示例2: update_lead_property

 public static function update_lead_property($lead_id, $property_name, $property_value, $update_akismet = true, $disable_hook = false)
 {
     global $wpdb;
     $lead_table = self::get_lead_table_name();
     $lead = self::get_lead($lead_id);
     //marking entry as 'spam' or 'not spam' with Akismet if the plugin is installed
     if ($update_akismet && GFCommon::akismet_enabled($lead['form_id']) && $property_name == 'status' && in_array($property_value, array('active', 'spam'))) {
         $current_status = $lead['status'];
         if ($current_status == 'spam' && $property_value == 'active') {
             $form = self::get_form_meta($lead['form_id']);
             GFCommon::mark_akismet_spam($form, $lead, false);
         } else {
             if ($current_status == 'active' && $property_value == 'spam') {
                 $form = self::get_form_meta($lead['form_id']);
                 GFCommon::mark_akismet_spam($form, $lead, true);
             }
         }
     }
     //updating lead
     $result = $wpdb->update($lead_table, array($property_name => $property_value), array('id' => $lead_id));
     echo $result . ' Prop Name: ' . $property_name;
     if (!$disable_hook) {
         $previous_value = rgar($lead, $property_name);
         if ($previous_value != $property_value) {
             // if property is status, prev value is spam and new value is active
             if ($property_name == 'status' && $previous_value == 'spam' && $property_value == 'active' && !rgar($lead, 'post_id')) {
                 $lead[$property_name] = $property_value;
                 $lead['post_id'] = GFCommon::create_post(isset($form) ? $form : GFAPI::get_form($lead['form_id']), $lead);
             }
             do_action("gform_update_{$property_name}", $lead_id, $property_value, $previous_value);
         }
     }
     return $result;
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:34,代码来源:forms_model.php

示例3: handle_submission

 public static function handle_submission($form, &$lead, $ajax = false)
 {
     //creating entry in DB
     RGFormsModel::save_lead($form, $lead);
     //reading entry that was just saved
     $lead = RGFormsModel::get_lead($lead["id"]);
     $lead = GFFormsModel::set_entry_meta($lead, $form);
     do_action('gform_entry_created', $lead, $form);
     //if Akismet plugin is installed, run lead through Akismet and mark it as Spam when appropriate
     $is_spam = false;
     if (GFCommon::akismet_enabled($form['id']) && GFCommon::is_akismet_spam($form, $lead)) {
         $is_spam = true;
     }
     if (!$is_spam) {
         GFCommon::create_post($form, $lead);
         //send auto-responder and notification emails
         self::send_emails($form, $lead);
     } else {
         //marking entry as spam
         RGFormsModel::update_lead_property($lead["id"], "status", "spam", false, true);
         $lead["status"] = "spam";
     }
     //display confirmation message or redirect to confirmation page
     return self::handle_confirmation($form, $lead, $ajax);
 }
开发者ID:pwillems,项目名称:mimosa-contents,代码行数:25,代码来源:form_display.php

示例4: handle_submission

 public static function handle_submission($form, &$lead, $ajax = false)
 {
     $lead_id = gf_apply_filters(array('gform_entry_id_pre_save_lead', $form['id']), null, $form);
     if (!empty($lead_id)) {
         if (empty($lead)) {
             $lead = array();
         }
         $lead['id'] = $lead_id;
     }
     //creating entry in DB
     RGFormsModel::save_lead($form, $lead);
     //reading entry that was just saved
     $lead = RGFormsModel::get_lead($lead['id']);
     $lead = GFFormsModel::set_entry_meta($lead, $form);
     //if Akismet plugin is installed, run lead through Akismet and mark it as Spam when appropriate
     $is_spam = GFCommon::akismet_enabled($form['id']) && GFCommon::is_akismet_spam($form, $lead);
     /**
      * A filter to set if an entry is spam
      *
      * @param int $form['id'] The Form ID to filter through (take directly from the form object)
      * @param bool $is_spam True or false to filter if the entry is spam
      * @param array $form The Form object to filer through
      * @param array $lead The Lead object to filter through
      */
     $is_spam = gf_apply_filters(array('gform_entry_is_spam', $form['id']), $is_spam, $form, $lead);
     if (GFCommon::spam_enabled($form['id'])) {
         GFCommon::log_debug('GFFormDisplay::handle_submission(): Akismet integration enabled OR gform_entry_is_spam hook in use.');
         $log_is_spam = $is_spam ? 'Yes' : 'No';
         GFCommon::log_debug("GFFormDisplay::handle_submission(): Is entry considered spam? {$log_is_spam}.");
     }
     if ($is_spam) {
         //marking entry as spam
         RGFormsModel::update_lead_property($lead['id'], 'status', 'spam', false, true);
         $lead['status'] = 'spam';
     }
     /**
      * Fired after an entry is created
      *
      * @param array $lead The Entry object
      * @param array $form The Form object
      */
     do_action('gform_entry_created', $lead, $form);
     $lead = gf_apply_filters(array('gform_entry_post_save', $form['id']), $lead, $form);
     RGFormsModel::set_current_lead($lead);
     if (!$is_spam) {
         GFCommon::create_post($form, $lead);
         //send notifications
         GFCommon::send_form_submission_notifications($form, $lead);
     }
     self::clean_up_files($form);
     // remove incomplete submission and purge expired
     if (rgars($form, 'save/enabled')) {
         GFFormsModel::delete_incomplete_submission(rgpost('gform_resume_token'));
         GFFormsModel::purge_expired_incomplete_submissions();
     }
     //display confirmation message or redirect to confirmation page
     return self::handle_confirmation($form, $lead, $ajax);
 }
开发者ID:timk85,项目名称:DIT,代码行数:58,代码来源:form_display.php

示例5: update_lead_property

 public static function update_lead_property($lead_id, $property_name, $property_value, $update_akismet = true, $disable_hook = false)
 {
     global $wpdb;
     $lead_table = self::get_lead_table_name();
     $lead = self::get_lead($lead_id);
     //marking entry as "spam" or "not spam" with Akismet if the plugin is installed
     if ($update_akismet && GFCommon::akismet_enabled($lead["form_id"]) && $property_name == "status" && in_array($property_value, array("active", "spam"))) {
         $current_status = $lead["status"];
         if ($current_status == "spam" && $property_value == "active") {
             $form = self::get_form_meta($lead["form_id"]);
             GFCommon::mark_akismet_spam($form, $lead, false);
         } else {
             if ($current_status == "active" && $property_value == "spam") {
                 $form = self::get_form_meta($lead["form_id"]);
                 GFCommon::mark_akismet_spam($form, $lead, true);
             }
         }
     }
     //updating lead
     $wpdb->update($lead_table, array($property_name => $property_value), array("id" => $lead_id));
     if (!$disable_hook) {
         $previous_value = rgar($lead, $property_name);
         if ($previous_value != $property_value) {
             // if property is status, prev value is spam and new value is active
             if ($property_name == 'status' && $previous_value == 'spam' && $property_value == 'active' && !rgar($lead, 'post_id')) {
                 $lead[$property_name] = $property_value;
                 $lead['post_id'] = GFCommon::create_post($form, $lead);
             }
             do_action("gform_update_{$property_name}", $lead_id, $property_value, $previous_value);
         }
     }
 }
开发者ID:pwillems,项目名称:mimosa-contents,代码行数:32,代码来源:forms_model.php

示例6: lead_detail_page


//.........这里部分代码省略.........
                    echo GFCommon::format_date($lead["payment_date"], false, "Y/m/d", $lead["transaction_type"] != 2);
                    ?>
                                                <br/><br/>
                                                <?php 
                }
                if (!empty($lead["transaction_id"])) {
                    echo $lead["transaction_type"] == 2 ? __("Subscriber Id", "gravityforms") : __("Transaction Id", "gravityforms");
                    ?>
: <?php 
                    echo $lead["transaction_id"];
                    ?>
                                                <br/><br/>
                                                <?php 
                }
                if (!rgblank($lead["payment_amount"])) {
                    echo $lead["transaction_type"] == 2 ? __("Subscription Amount", "gravityforms") : __("Payment Amount", "gravityforms");
                    ?>
: <?php 
                    echo GFCommon::to_money($lead["payment_amount"], $lead["currency"]);
                    ?>
                                                <br/><br/>
                                                <?php 
                }
            }
        }
        do_action("gform_entry_info", $form["id"], $lead);
        ?>
                                </div>
                                <div id="major-publishing-actions">
                                    <div id="delete-action">
                                        <?php 
        switch ($lead["status"]) {
            case "spam":
                if (GFCommon::akismet_enabled($form['id'])) {
                    ?>
                                                    <a onclick="jQuery('#action').val('unspam'); jQuery('#entry_form').submit()" href="#"><?php 
                    _e("Not Spam", "gravityforms");
                    ?>
</a>
                                                    <?php 
                    echo GFCommon::current_user_can_any("gravityforms_delete_entries") ? "|" : "";
                }
                if (GFCommon::current_user_can_any("gravityforms_delete_entries")) {
                    ?>
                                                    <a class="submitdelete deletion" onclick="if ( confirm('<?php 
                    _e("You are about to delete this entry. \\'Cancel\\' to stop, \\'OK\\' to delete.", "gravityforms");
                    ?>
') ) {jQuery('#action').val('delete'); jQuery('#entry_form').submit(); return true;} return false;" href="#"><?php 
                    _e("Delete Permanently", "gravityforms");
                    ?>
</a>
                                                    <?php 
                }
                break;
            case "trash":
                ?>
                                                <a onclick="jQuery('#action').val('restore'); jQuery('#entry_form').submit()" href="#"><?php 
                _e("Restore", "gravityforms");
                ?>
</a>
                                                <?php 
                if (GFCommon::current_user_can_any("gravityforms_delete_entries")) {
                    ?>
                                                    |
                                                    <a class="submitdelete deletion" onclick="if ( confirm('<?php 
                    _e("You are about to delete this entry. \\'Cancel\\' to stop, \\'OK\\' to delete.", "gravityforms");
开发者ID:JSpier,项目名称:smacamp,代码行数:67,代码来源:entry_detail.php

示例7: leads_page


//.........这里部分代码省略.........
        _e("All", "gravityforms");
        ?>
 <span class="count">(<span id="all_count"><?php 
        echo $active_lead_count;
        ?>
</span>)</span></a> | </li>
                    <li><a class="<?php 
        echo $read !== null ? "current" : "";
        ?>
" href="?page=gf_entries&view=entries&id=<?php 
        echo $form_id;
        ?>
&filter=unread"><?php 
        _e("Unread", "gravityforms");
        ?>
 <span class="count">(<span id="unread_count"><?php 
        echo $unread_count;
        ?>
</span>)</span></a> | </li>
                    <li><a class="<?php 
        echo $star !== null ? "current" : "";
        ?>
" href="?page=gf_entries&view=entries&id=<?php 
        echo $form_id;
        ?>
&filter=star"><?php 
        _e("Starred", "gravityforms");
        ?>
 <span class="count">(<span id="star_count"><?php 
        echo $starred_count;
        ?>
</span>)</span></a> | </li>
                    <?php 
        if (GFCommon::akismet_enabled($form_id)) {
            ?>
                        <li><a class="<?php 
            echo $filter == "spam" ? "current" : "";
            ?>
" href="?page=gf_entries&view=entries&id=<?php 
            echo $form_id;
            ?>
&filter=spam"><?php 
            _e("Spam", "gravityforms");
            ?>
 <span class="count">(<span id="spam_count"><?php 
            echo $spam_count;
            ?>
</span>)</span></a> | </li>
                        <?php 
        }
        ?>
                    <li><a class="<?php 
        echo $filter == "trash" ? "current" : "";
        ?>
" href="?page=gf_entries&view=entries&id=<?php 
        echo $form_id;
        ?>
&filter=trash"><?php 
        _e("Trash", "gravityforms");
        ?>
 <span class="count">(<span id="trash_count"><?php 
        echo $trash_count;
        ?>
</span>)</span></a></li>
                </ul>
                <p class="search-box">
开发者ID:nikibrown,项目名称:2014-Nerd-presentation,代码行数:67,代码来源:entry_list.php

示例8: handle_submission

    public static function handle_submission($form, &$lead, $ajax=false){

        $lead_id = apply_filters("gform_entry_id_pre_save_lead{$form["id"]}", apply_filters("gform_entry_id_pre_save_lead", null, $form), $form);

        if(!empty($lead_id)){
            if(empty($lead))
                $lead = array();
            $lead["id"] = $lead_id;
        }

        //creating entry in DB
        RGFormsModel::save_lead($form, $lead);

        //reading entry that was just saved
        $lead = RGFormsModel::get_lead($lead["id"]);

		$lead = GFFormsModel::set_entry_meta($lead, $form);

        do_action('gform_entry_created', $lead, $form);
        $lead = apply_filters('gform_entry_post_save', $lead, $form);

        RGFormsModel::set_current_lead($lead);

        //if Akismet plugin is installed, run lead through Akismet and mark it as Spam when appropriate
        $is_spam = GFCommon::akismet_enabled($form['id']) && GFCommon::is_akismet_spam($form, $lead);

        GFCommon::log_debug("Checking for spam...");
        GFCommon::log_debug("Is entry considered spam? {$is_spam}.");

        if(!$is_spam){
            GFCommon::create_post($form, $lead);
            //send notifications
            GFCommon::send_form_submission_notifications($form, $lead);
        }
        else {
            //marking entry as spam
            RGFormsModel::update_lead_property($lead["id"], "status", "spam", false, true);
            $lead["status"] = "spam";
        }

        self::clean_up_files($form);

        //display confirmation message or redirect to confirmation page
        return self::handle_confirmation($form, $lead, $ajax);
    }
开发者ID:bmontague,项目名称:sct,代码行数:45,代码来源:form_display.php

示例9: update_lead_property

 public static function update_lead_property($lead_id, $property_name, $property_value, $update_akismet = true, $disable_hook = false)
 {
     global $wpdb;
     $lead_table = self::get_lead_table_name();
     $lead = self::get_lead($lead_id);
     //marking entry as 'spam' or 'not spam' with Akismet if the plugin is installed
     if ($update_akismet && GFCommon::akismet_enabled($lead['form_id']) && $property_name == 'status' && in_array($property_value, array('active', 'spam'))) {
         $current_status = $lead['status'];
         if ($current_status == 'spam' && $property_value == 'active') {
             $form = self::get_form_meta($lead['form_id']);
             GFCommon::mark_akismet_spam($form, $lead, false);
         } else {
             if ($current_status == 'active' && $property_value == 'spam') {
                 $form = self::get_form_meta($lead['form_id']);
                 GFCommon::mark_akismet_spam($form, $lead, true);
             }
         }
     }
     //updating lead
     $result = $wpdb->update($lead_table, array($property_name => $property_value), array('id' => $lead_id));
     if (!$disable_hook) {
         $previous_value = rgar($lead, $property_name);
         if ($previous_value != $property_value) {
             // if property is status, prev value is spam and new value is active
             if ($property_name == 'status' && $previous_value == 'spam' && $property_value == 'active' && !rgar($lead, 'post_id')) {
                 $lead[$property_name] = $property_value;
                 $lead['post_id'] = GFCommon::create_post(isset($form) ? $form : GFAPI::get_form($lead['form_id']), $lead);
             }
             /**
              * Fired after an entry property is updated
              *
              * @param string $property_name Used within the action string.  Defines the property that fires the action.
              *
              * @param int    $lead_id        The Entry ID
              * @param string $property_value The new value of the property that was updated
              * @param string $previous_value The previous property value before the update
              */
             do_action("gform_update_{$property_name}", $lead_id, $property_value, $previous_value);
         }
     }
     return $result;
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:42,代码来源:forms_model.php

示例10: lead_detail_page


//.........这里部分代码省略.........
: <?php 
                echo GFCommon::format_date($lead["payment_date"], false, "Y/m/d", $lead["transaction_type"] == 1);
                ?>
                                            <br/><br/>
                                            <?php 
            }
            if (!empty($lead["transaction_id"])) {
                echo $lead["transaction_type"] == 1 ? __("Transaction Id", "gravityforms") : __("Subscriber Id", "gravityforms");
                ?>
: <?php 
                echo $lead["transaction_id"];
                ?>
                                            <br/><br/>
                                            <?php 
            }
            if (!rgblank($lead["payment_amount"])) {
                echo $lead["transaction_type"] == 1 ? __("Payment Amount", "gravityforms") : __("Subscription Amount", "gravityforms");
                ?>
: <?php 
                echo GFCommon::to_money($lead["payment_amount"], $lead["currency"]);
                ?>
                                            <br/><br/>
                                            <?php 
            }
        }
        do_action("gform_entry_info", $form["id"], $lead);
        ?>
                                </div>
                                <div id="major-publishing-actions">
                                    <div>
                                        <?php 
        switch ($lead["status"]) {
            case "spam":
                if (GFCommon::akismet_enabled($form['id'])) {
                    ?>
                                                    <a onclick="jQuery('#action').val('unspam'); jQuery('#entry_form').submit()" href="#"><?php 
                    _e("Not Spam", "gravityforms");
                    ?>
</a>
                                                    <?php 
                    echo GFCommon::current_user_can_any("gravityforms_delete_entries") ? "|" : "";
                }
                if (GFCommon::current_user_can_any("gravityforms_delete_entries")) {
                    ?>
                                                    <a class="submitdelete deletion" onclick="if ( confirm('<?php 
                    _e("You are about to delete this entry. \\'Cancel\\' to stop, \\'OK\\' to delete.", "gravityforms");
                    ?>
') ) {jQuery('#action').val('delete'); jQuery('#entry_form').submit(); return true;} return false;" href="#"><?php 
                    _e("Delete Permanently", "gravityforms");
                    ?>
</a>
                                                    <?php 
                }
                break;
            case "trash":
                ?>
                                                <a onclick="jQuery('#action').val('restore'); jQuery('#entry_form').submit()" href="#"><?php 
                _e("Restore", "gravityforms");
                ?>
</a>
                                                <?php 
                if (GFCommon::current_user_can_any("gravityforms_delete_entries")) {
                    ?>
                                                    |
                                                    <a class="submitdelete deletion" onclick="if ( confirm('<?php 
                    _e("You are about to delete this entry. \\'Cancel\\' to stop, \\'OK\\' to delete.", "gravityforms");
开发者ID:xeyefex,项目名称:Mixd-WordPress-Framework,代码行数:67,代码来源:entry_detail.php

示例11: handle_row_actions


//.........这里部分代码省略.........
                ?>
" title="Mark this entry as read" href="javascript:ToggleRead('<?php 
                echo esc_js($entry['id']);
                ?>
', '<?php 
                echo esc_js($this->filter);
                ?>
');" style="display:<?php 
                echo $entry['is_read'] ? 'none' : 'inline';
                ?>
;"><?php 
                esc_html_e('Mark read', 'gravityforms');
                ?>
</a><a id="mark_unread_<?php 
                echo absint($entry['id']);
                ?>
" title="<?php 
                esc_attr_e('Mark this entry as unread', 'gravityforms');
                ?>
" href="javascript:ToggleRead('<?php 
                echo esc_js($entry['id']);
                ?>
', '<?php 
                echo esc_js($this->filter);
                ?>
');" style="display:<?php 
                echo $entry['is_read'] ? 'inline' : 'none';
                ?>
;"><?php 
                esc_html_e('Mark unread', 'gravityforms');
                ?>
</a>
						<?php 
                echo GFCommon::current_user_can_any('gravityforms_delete_entries') || GFCommon::akismet_enabled($form_id) ? '|' : '';
                ?>
                    </span>
					<?php 
                if (GFCommon::spam_enabled($form_id)) {
                    ?>
						<span class="spam">
                            <a data-wp-lists='delete:the-list:entry_row_<?php 
                    echo esc_attr($entry['id']);
                    ?>
::status=spam&entry=<?php 
                    echo esc_attr($entry['id']);
                    ?>
' title="<?php 
                    esc_attr_e('Mark this entry as spam', 'gravityforms');
                    ?>
" href="<?php 
                    echo wp_nonce_url('?page=gf_entries', 'gf_delete_entry');
                    ?>
"><?php 
                    esc_html_e('Spam', 'gravityforms');
                    ?>
</a>
							<?php 
                    echo GFCommon::current_user_can_any('gravityforms_delete_entries') ? '|' : '';
                    ?>
                        </span>

						<?php 
                }
                if (GFCommon::current_user_can_any('gravityforms_delete_entries')) {
                    ?>
						<span class="trash">
开发者ID:arobbins,项目名称:spellestate,代码行数:67,代码来源:entry_list.php


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