當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Akismet::pingback_forwarded_for方法代碼示例

本文整理匯總了PHP中Akismet::pingback_forwarded_for方法的典型用法代碼示例。如果您正苦於以下問題:PHP Akismet::pingback_forwarded_for方法的具體用法?PHP Akismet::pingback_forwarded_for怎麽用?PHP Akismet::pingback_forwarded_for使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Akismet的用法示例。


在下文中一共展示了Akismet::pingback_forwarded_for方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: pre_check_pingback

 public static function pre_check_pingback($method)
 {
     if ($method !== 'pingback.ping') {
         return;
     }
     global $wp_xmlrpc_server;
     if (!is_object($wp_xmlrpc_server)) {
         return false;
     }
     // Lame: tightly coupled with the IXR class.
     $args = $wp_xmlrpc_server->message->params;
     if (!empty($args[1])) {
         $post_id = url_to_postid($args[1]);
         // If this gets through the pre-check, make sure we properly identify the outbound request as a pingback verification
         Akismet::pingback_forwarded_for(null, $args[0]);
         add_filter('http_request_args', array('Akismet', 'pingback_forwarded_for'), 10, 2);
         $comment = array('comment_author_url' => $args[0], 'comment_post_ID' => $post_id, 'comment_author' => '', 'comment_author_email' => '', 'comment_content' => '', 'comment_type' => 'pingback', 'akismet_pre_check' => '1', 'comment_pingback_target' => $args[1]);
         $comment = Akismet::auto_check_comment($comment);
         if (isset($comment['akismet_result']) && 'true' == $comment['akismet_result']) {
             // Lame: tightly coupled with the IXR classes. Unfortunately the action provides no context and no way to return anything.
             $wp_xmlrpc_server->error(new IXR_Error(0, 'Invalid discovery target'));
         }
     }
 }
開發者ID:onedaylabs,項目名稱:onedaylabs.com,代碼行數:24,代碼來源:class.akismet.php

示例2: akismet_pingback_forwarded_for

function akismet_pingback_forwarded_for($r, $url)
{
    return Akismet::pingback_forwarded_for($r, $url);
}
開發者ID:TheHiddenHaku,項目名稱:fuzzy-waddle,代碼行數:4,代碼來源:wrapper.php


注:本文中的Akismet::pingback_forwarded_for方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。