{"id":32015,"date":"2024-11-25T15:08:03","date_gmt":"2024-11-25T07:08:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/32015\/"},"modified":"2024-11-25T15:08:03","modified_gmt":"2024-11-25T07:08:03","slug":"%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8eyar%e7%9a%84wordpress%e5%be%ae%e5%8d%9a%e5%a2%99%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/32015\/","title":{"rendered":"\u5206\u4eab\u4e00\u4e2a\u57fa\u4e8eYar\u7684WordPress\u5fae\u535a\u5899\u63d2\u4ef6"},"content":{"rendered":"<p><strong>\u57fa\u4e8eYar\u7684WordPress\u5fae\u535a\u5899\u63d2\u4ef6<\/strong> <\/p>\n<p>\u5728\u73b0\u5728\u79fb\u52a8\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u5fae\u535a\u5df2\u7ecf\u6210\u4e3a\u4e86\u6bcf\u4e2a\u4eba\u751f\u6d3b\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e00\u4e2a\u793e\u4ea4\u5de5\u5177\u3002\u800c\/&#8221; target=&#8221;_blank&#8221;&gt;wordpress\u662f\u5168\u4e16\u754c\u6700\u4e3a\u6d41\u884c\u7684\u535a\u5ba2\u7cfb\u7edf\uff0c\u628a\u4f60\u7684\u535a\u5ba2\u63a5\u5165\u65b0\u6d6a\u5fae\u535a\uff0c\u501f\u52a9\u5fae\u535a\u7684\u5f3a\u5927\u7528\u6237\u7fa4\uff0c\u4e0d\u4ec5\u80fd\u7ed9\u4f60\u7684\u7f51\u7ad9\u63d0\u4f9b\u5de8\u5927\u7684\u6d41\u91cf\uff0c\u800c\u4e14\u8fd8\u80fd\u5e26\u6765\u4e0d\u53ef\u4f30\u91cf\u4ef7\u503c\u3002<\/p>\n<p>WordPress\u5fae\u535a\u5899\u5c31\u662f\u8fd9\u6837\u7684\u4e00\u4e2a\u5de5\u5177\uff0c\u8fd9\u4e0d\u662f\u4e00\u6b3e\u666e\u901a\u7684\u63d2\u4ef6\uff0c\u8fd9\u662f\u4e00\u6b3e\u642d\u5efa\u5728SAE\u57fa\u4e8eYar\u7684\u63d2\u4ef6\u3002\u5b83\u975e\u5e38\u7684\u8f7b\u91cf\uff0c\u5b83\u4e0d\u50cf\u5176\u4ed6\u7684\u63d2\u4ef6\u90a3\u6837\uff0c\u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u534e\u4e3d\u5374\u4e0d\u5b9e\u7528\u7684\u529f\u80fd\uff0c\u4e0d\u4ec5\u81c3\u80bf\u800c\u4e14\u62d6\u6162\u901f\u5ea6\u3002\u8fd9\u662f\u4e00\u6b3e\u57fa\u4e8eYar\u7684\u63d2\u4ef6\uff0c\u5e95\u5c42C\u8bed\u8a00\u5f00\u53d1\uff0c\u6027\u80fd\u5353\u8d8a\u3002\u800c\u4e14\u62d3\u5c55\u6027\u5f88\u597d\uff0c\u53ef\u4ee5\u7ed9\u4f60\u63d0\u4f9b\u4e00\u4e0b\u529f\u80fd\uff1a<\/p>\n<p>1.\u4e2a\u4eba\u5fae\u535a\u5899<br \/>2.\u53d1\u5e03\u6587\u7ae0\u540c\u6b65\u5230\u65b0\u6d6a\u5fae\u535a<br \/>3.\u6587\u7ae0\u8bc4\u8bba\u540c\u6b65\u5230\u65b0\u6d6a\u5fae\u535a<br \/>\u63a5\u4e0b\u6765\u4ecb\u7ecd\u4e00\u4e0b\u57fa\u672c\u7ed3\u6784\uff1a<\/p>\n<h1>1 \u6838\u5fc3\u6570\u636e\u64cd\u4f5c\u7c7b<\/h1>\n<p>\u8fd9\u4e2a\u7c7b\u5728Dao.class.php\u6587\u4ef6\u4e2d\uff0c\u5b83\u662f\u63d2\u4ef6\u7684\u6838\u5fc3\uff0c\u8d1f\u8d23\u53bb\u670d\u52a1\u7aef\u83b7\u53d6\u6570\u636e<\/p>\n<pre>\/**\n*\n*\t\u7528\u6237\u6570\u636e\u83b7\u53d6\u7c7b\n*\t@author \u590f\u5929\n*\t@date 2015\u5e746\u670828\u65e5\n*\t@site http:\/\/www.xtwind.com\n*\n*\/\nclass Dao{\n\t\/**\n\t*\t\u5fae\u535aRPC\u64cd\u4f5c\u5bf9\u8c61\n\t*\/\n\tprivate $client;\n\n\t\/**\n\t*\t\u7528\u6237\u6807\u8bc6\n\t*\/\n\tprivate $mark;\n\n\t\/**\n\t*\t\u6784\u9020\u51fd\u6570\u8bbe\u7f6e\u7528\u6237\u6807\u8bc6\n\t*\/\n\tfunction __construct($state);\n\n\t\/**\n\t*\t\u8fd4\u56de\u7528\u6237\u6807\u8bc6\n\t*\/\n\tpublic function getMark();\n \n\t\/**\n\t*\t\u542f\u7528\u63d2\u4ef6\n\t*\t@return \u6210\u529f\u8fd4\u56detrue\uff0c\u5931\u8d25\u8fd4\u56de\u8ba4\u8bc1\u5730\u5740 \n\t*\/\n\tpublic function run();\n\n\t\/**\n\t*\t\u83b7\u53d6\u6388\u6743\u60c5\u51b5\n\t* \t@return string \u8fd4\u56de\u8fc7\u671f\u65f6\u95f4,\u672a\u767b\u5f55\u6216\u8005\u8fc7\u671f\u8fd4\u56defalse\n\t*\/\n\tpublic function getAuthOver();\n\n\t\/**\n\t*\t\u5220\u9664\u6388\u6743\n\t*\t@return boolean\n\t*\/\n\tpublic function delAuth();\n\n\t\/**\n\t*\t\u83b7\u53d6\u8ba4\u8bc1\u8df3\u8f6curl\n\t*\t@return string\n\t*\/\n\tpublic function getAuthUrl();\n\n\t\/**\n\t*\t\u83b7\u53d6\u7528\u6237\u5fae\u535a\u5217\u8868\n\t* \t@return array\n\t*\/\n\tpublic function getWeibo();\n\n\t\/**\n\t*\t\u83b7\u53d6\u7528\u6237\u57fa\u672c\u4fe1\u606f\n\t* \t@return array\n\t*\/\n\tpublic function getUser();\n\n\t\/**\n\t*\t\u53d1\u5e03\u5fae\u535a\n\t*\t@return Array \u8fd4\u56de\u5fae\u535a\u6570\u636e\u6570\u7ec4\n\t*\/\n\tpublic function weiboPub($content,$imgUrl=null);\n\n\t\/**\n\t*\t\u5220\u9664\u5fae\u535a\n\t*\t@param  int  \u5fae\u535aID\n\t*\t@return Array \u8fd4\u56de\u88ab\u5220\u9664\u5fae\u535a\u6570\u636e\u6570\u7ec4\n\t*\/\n\tpublic function weiboDel($weiboID);\n\n\t\/**\n\t*\t\u53d1\u5e03\u4e00\u6761\u8bc4\u8bba\u8fc7\n\t*\t@param  int  \u5fae\u535aID\n\t*\t@param \tstring  \u8bc4\u8bba\u5185\u5bb9\n\t*\t@return array \u8bc4\u8bba\u76f8\u5173\u6570\u7ec4\n\t*\/\n\tpublic function sendComment($id,$comment);\n\n\t\/**\n\t*\t\u5173\u6ce8\u4e00\u4e2a\u7528\u6237\n\t*\t@param \u7528\u6237ID\u6216\u8005\u540d\u5b57\n\t*\t@return \u8fd4\u56de\u5173\u6ce8\u8005\u4fe1\u606f\n\t*\/\n\tpublic function followUser($user);\n\n\t\/**\n\t*\t\u8f6c\u53d1\u5fae\u535a\n\t*\t@param int \u5fae\u535aid\n\t*\t@param string \u6dfb\u52a0\u7684\u5185\u5bb9\n\t*\/\n\tpublic function forwardWeibo($id,$text=null);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>2 \u63d2\u4ef6\u5b9e\u4f53\u7c7b<\/h1>\n<p>\u8be5\u7c7b\u662f\u63d2\u4ef6\u7684\u5b9e\u4f53\uff0c\u5728Plugins.class.php\u4e2d\u5b9a\u4e49\uff0c\u8d1f\u8d23\u8c03\u7528Dao\u7c7b\u6765\u5b9e\u73b0\u5404\u79cd\u529f\u80fd\uff0c\u5305\u62ec\u8f93\u5165\u8f93\u51fa\uff0c\u7528\u6237\u914d\u7f6e\uff0c\u6388\u6743\u7ba1\u7406<\/p>\n<pre>\/**\n*\t\u63d2\u4ef6\u5b9e\u4f53\u7c7b\n*\t@Author\uff1aSummer\n*\t@data\uff1a  2015-06-28\n*\t@site\uff1a  http:\/\/www.xtwind.com\n*\/\nclass Plugins{\n\t\/**\n\t*\t\u6570\u636e\u83b7\u53d6\u7c7b\u5bf9\u8c61\n\t*\/\n\tprivate $dao;\n\n\t\/**\n\t*\t\u63d2\u4ef6\u663e\u793a\u522b\u540d\n\t*\/\n\tprivate $slug = 'weibo-wall';\n\n\t\/**\n\t*\t\u63d2\u4ef6\u9875url\n\t*\/\n\tprivate $plugUrl ;\n\n\t\/*\n\t*\t\u63d2\u4ef6\u6784\u9020\n\t* \t@param \u7528\u6237\u6570\u636e\u64cd\u4f5c\u7c7b\n\t*\/\n\tpublic function __construct(Dao $obj);\n\n\t\/**\n\t*\t\u542f\u7528\u63d2\u4ef6\uff0c\u6ce8\u518c\u94a9\u5b50\uff0c\u8c03\u7528\u7528\u6237\u51fd\u6570\uff0c\u5220\u9664\u6388\u6743\uff0c\u53d1\u8868\u5fae\u535a\n\t* \t@param array \u63d2\u4ef6\u8bbe\u7f6e\u9009\u9879\u5173\u8054\u6570\u7ec4,key\u5fc5\u987b\u4e3a\u5bf9\u5e94\u7684\u64cd\u4f5c\u65b9\u6cd5,\u8be5\u6570\u7ec4\u4e2d\u7684\u952e\u4f1a\u88ab\u6ce8\u518c\u4e3awordpress\u76f8\u5e94\u94a9\u5b50\n\t* \t@param array \u9700\u8981\u8fc7\u6ee4\u7684\u52a8\u4f5c\uff0c\u8be5\u6570\u7ec4\u4e2d\u952e\u4e0d\u4f1a\u88ab\u6ce8\u518c\u4e3a\u94a9\u5b50\uff0c\u4f46\u662f\u4f1a\u4f5c\u4e3a\u65b9\u6cd5\u88ab\u8c03\u7528\uff0c\u503c\u4e3a\u65b9\u6cd5\u7684\u53c2\u6570\n\t*\/\n\tpublic function run($arr1=null,$arr2=null);\n\n\t\/**\n\t*\t\u63d2\u4ef6\u4e3b\u9875\u663e\u793a\n\t*\/\n\tpublic function display_function();\n\n\t\/**\n\t*\t\u65b0\u6587\u7ae0\u540c\u6b65\u53d1\u5e03\u5fae\u535a\n\t* \t@param \tint \u6587\u7ae0ID\n\t*\/\n\tpublic function publish_post($postID);\n\n\t\/**\n\t*\t\u5220\u9664\u6587\u7ae0\u540c\u6b65\u5220\u9664\u5fae\u535a\n\t* \t@param int \u6587\u7ae0ID \n\t*\/\n\tpublic function before_delete_post($postID);\n\n\t\/**\n\t*\t\u6536\u5230\u8bc4\u8bba\u540c\u6b65\u5230\u5fae\u535a\u8bc4\u8bba\n\t*\t@param id \u8bc4\u8bbaid\n\t*\/\n\tpublic function comment_post($commentID);\n\n\t\/**\n\t*\t\u5173\u6ce8\u4f5c\u8005\n\t*\/\n\tpublic function follow_author($userid);\n\n\t\/**\n\t*\t\u7528\u6237\u5fae\u535a\u6570\u636e\u83b7\u53d6\n\t*\/\n\tpublic function weiboOuput( $atts=null, $content = null );\n\t\/**\n\t*\t\u6570\u636e\u9875\u9762\u8f93\u51fa\n\t*\/\n\tpublic function showWeibo();\n\n\t\/**\n\t*\t\u56fe\u7247URL\u5904\u7406\n\t* \t@param string\n\t*\/\n\tprivate function getOriginalUrl($url);\n\n\t\/**\n\t*\t\u65f6\u95f4\u8f6c\u6362\n\t* \t@param string\n\t*\/\n\tprivate function Sec2Time($time);\n\n\t\/**\n\t*\t\u63d2\u4ef6\u8bbe\u7f6ekey\u83b7\u53d6\n\t* \t@param string \t\u9700\u8981\u8bbe\u7f6e\u7684key\n\t*\/\n\tprivate function setting_key($key,$func=false);\n\n\t\/**\n\t*\t\u63d2\u4ef6\u8bbe\u7f6evalue\u83b7\u53d6\n\t* \t@param string \t\u9700\u8981\u83b7\u53d6\u7684value\n\t*\/\n\tprivate function get_setting($key,$func=false);\n\n\t\/**\n\t*\t\u63d2\u4ef6\u8bbe\u7f6e\u5220\u9664\n\t*\/\t\n\tprivate function del_setting();\n\n\t\/**\n\t*\t\u63d0\u793a\u4fe1\u606f\n\t*\t@param string\n\t*\/\n\tprivate function noticeMsg($msg);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>3 \u670d\u52a1\u7aef\u8ba4\u8bc1\u64cd\u4f5c<\/h1>\n<p>\u8be5\u63a5\u53e3\u5b9a\u4e49\u6240\u6709\u7528\u6237\u8ba4\u8bc1\u9700\u8981\u7684\u64cd\u4f5c\uff0c\u5305\u62ec\u83b7\u53d6\u6388\u6743\uff0c\u5220\u9664\u6388\u6743\uff0c\u68c0\u67e5\u6388\u6743\u7b49\uff0c\u5728AuthDao.php\u5b9a\u4e49<\/p>\n<pre>\/**\n*\t\u8ba4\u8bc1\u64cd\u4f5c\u7c7b\u63a5\u53e3\n*\t@author \u590f\u5929\n*\t@date 2015\u5e746\u670818\u65e5\n*\t@site http:\/\/www.xtwind.com\n*\/\ninterface AuthDao{\n\t\/**\n\t*\t\u8bbe\u7f6e\u7528\u6237AccessToken\n\t*\t@return boolean\n\t*\/\n\tpublic function setAccessToken();\n\n\t\/**\n\t*\t\u83b7\u53d6\u7528\u6237AccessToken\n\t*\t@return String \n\t*\/\n\tpublic function getAccessToken();\n\n\t\/**\n\t*\t\u5220\u9664\u7528\u6237AccessToken\n\t*\t@return boolean\n\t*\/\n\tpublic function delAccessToken();\n\n\t\/**\n\t*\t\u5224\u65ad\u7528\u6237AccessToken\u662f\u5426\u5b58\u5728\n\t*\t@return boolean\n\t*\/\n\tpublic function isLogin();\n\n\t\/**\n\t*\t\u83b7\u53d6\u8ba4\u8bc1\u8df3\u8f6curl\n\t*\t@return string\n\t*\/\n\tpublic function getAuthUrl();\n\n\t\/**\n\t*\t\u6388\u6743\u8fc7\u671f\u65f6\u95f4\n\t*\t@return string\n\t*\/\n\tpublic function getAuthOver();\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>4 \u670d\u52a1\u7aef\u5fae\u535a\u64cd\u4f5c<\/h1>\n<p>\u8be5\u63a5\u53e3\u5b9a\u4e49\u6240\u6709\u4e0e\u7528\u6237\u5fae\u535a\u64cd\u4f5c\u76f8\u5173\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u53d1\u8868\u5fae\u535a\uff0c\u8bfb\u53d6\u5fae\u535a\uff0c\u8bfb\u53d6\u4fe1\u606f\uff0c\u5220\u9664\u5fae\u535a\u7b49\u7b49\uff0c\u5728WeiboDao.php\u5b9a\u4e49<\/p>\n<pre>\/**\n*\t\u5fae\u535a\u64cd\u4f5c\u7c7b\u63a5\u53e3\n*\t@author \u590f\u5929\n*\t@date 2015\u5e746\u670818\u65e5\n*\t@site http:\/\/www.xtwind.com\n*\/\n\ninterface WeiboDao {\n\n\t\/**\n\t*\t\u83b7\u53d6\u7528\u6237\u5fae\u535a\u4fe1\u606f\u5217\u8868\n\t*\t@param  int \t\u83b7\u53d6\u6570\u91cf\n\t*\t@param  int \t\u7c7b\u578b\u8fc7\u6ee4  0\uff1a\u5168\u90e8\u30011\uff1a\u539f\u521b\u30012\uff1a\u56fe\u7247\u30013\uff1a\u89c6\u9891\u30014\uff1a\u97f3\u4e50\uff0c\u9ed8\u8ba4\u4e3a0\u3002\n\t*\t@return String\n\t*\/\n\tpublic function getWeibo();\n\n\t\/**\n\t*\t\u83b7\u53d6\u7528\u6237\u57fa\u672c\u4fe1\u606f\n\t*\t@return Array\n\t*\/\n\tpublic function getUser();\n\n\t\/**\n\t*\t\u53d1\u5e03\u5fae\u535a\n\t*\t@return Array \u8fd4\u56de\u5fae\u535a\u6570\u636e\u6570\u7ec4\n\t*\/\n\tpublic function weiboPub($content,$imgUrl);\n\n\t\/**\n\t*\t\u5220\u9664\u5fae\u535a\n\t*\t@return Array \u8fd4\u56de\u88ab\u5220\u9664\u5fae\u535a\u6570\u636e\u6570\u7ec4\n\t*\/\n\tpublic function weiboDel($weiboID);\n\n\t\/**\n\t*\t\u53d1\u5e03\u4e00\u6761\u8bc4\u8bba\n\t*\t@param integer \u5fae\u535aID\n\t*\t@param string  \u8bc4\u8bba\u5185\u5bb9\n\t*\/\n\tpublic function sendComment($id,$comment);\n\n\t\/**\n\t*\t\u5173\u6ce8\u4e00\u4e2a\u7528\u6237\n\t*\t@param \u7528\u6237ID\u6216\u8005\u540d\u5b57\n\t*\t@return \u8fd4\u56de\u5173\u6ce8\u8005\u4fe1\u606f\n\t*\/\n\tpublic function followUser($user);\n\n\t\/**\n\t*\t\u8f6c\u53d1\u5fae\u535a\n\t*\t@param int \u5fae\u535aid\n\t*\t@param string \u6dfb\u52a0\u7684\u4fe1\u606f\n\t*\/\n\tpublic function forwardWeibo($id,$text=null);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>5 \u670d\u52a1\u7aef\u6570\u636e\u63d0\u4f9b\u63a5\u53e3<\/h1>\n<p>\u8be5\u63a5\u53e3\u8d1f\u8d23\u63d0\u4f9b\u6570\u636e\u7ed9\u5ba2\u6237\u7aef\uff0c\u4ee5\u53ca\u4e00\u4e9b\u5ba2\u6237\u7aef\u9700\u8981\u7684\u64cd\u4f5c\uff0c\u7ee7\u627f\u4e8e\u5fae\u535a\u64cd\u4f5c\u63a5\u53e3\uff0c\u5728APIDao.php\u4e2d\u5b9a\u4e49<\/p>\n<pre>\/**\n*\t\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u7c7b\u63a5\u53e3\uff0c\u7ee7\u627f\u4e8e\u5fae\u535a\u64cd\u4f5c\u63a5\u53e3\n*\t@author \u590f\u5929\n*\t@date 2015\u5e746\u670818\u65e5\n*\t@site http:\/\/www.xtwind.com\n*\/\ninterface DaoAPI extends WeiboDao{\n\t\/**\n\t*\t\u5220\u9664\u7528\u6237AccessToken\n\t*\t@return boolean\n\t*\/\n\tpublic function delAccessToken();\n\n\t\/**\n\t*\t\u5224\u65ad\u7528\u6237AccessToken\u662f\u5426\u5b58\u5728\n\t*\t@return boolean\n\t*\/\n\tpublic function isLogin();\n\n\t\/**\n\t*\t\u83b7\u53d6\u8ba4\u8bc1\u8df3\u8f6curl\n\t*\t@return string\n\t*\/\n\tpublic function getAuthUrl();\n\n\t\/**\n\t*\t\u6388\u6743\u8fc7\u671f\u65f6\u95f4\n\t*\t@return string\n\t*\/\n\tpublic function getAuthOver();\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>6 \u670d\u52a1\u7aef\u56de\u8c03\u64cd\u4f5c<\/h1>\n<p>\u8be5\u7c7b\u5c01\u88c5\u4e0e\u5fae\u535a\u5f00\u653e\u5e73\u53f0\u901a\u4fe1\u83b7\u53d6\u7528\u6237AccessToken\u540e\u7684\u56de\u8c03\u64cd\u4f5c<\/p>\n<pre>class Callback {\n\t\/**\n\t*\t\u5fae\u535a\u8ba4\u8bc1\u7c7b\u5bf9\u8c61\n\t*\/\n\tprivate $authObj;\n\n\t\/**\n\t*\t\u6784\u9020\u51fd\u6570\n\t*\t@param AuthDaoImpl \u5fae\u535a\u8ba4\u8bc1\u5bf9\u8c61\n\t*\/\n\tpublic function __construct(AuthDaoImpl $obj)\uff1b\n\n\t\/**\n\t*\t\u8ba4\u8bc1\u56de\u8c03\u64cd\u4f5c,\u4fdd\u5b58AccessToken\n\t* \t@return boolean\n\t*\/\n\tpublic function callback()\uff1b\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>7 \u670d\u52a1\u7aef\u5e94\u7528\u5165\u53e3<\/h1>\n<p>\u8be5\u5165\u53e3\u4e3b\u8981\u662f\u5206\u53d1\u56de\u8c03\u8bf7\u6c42\uff0c\u4ee5\u53ca\u521b\u5efaRPC\u5b9e\u4f8b<\/p>\n<pre>if($_GET['code']){\n\t$keys = array(\n\t\t\t'code' =&gt; $_GET['code'],\n\t\t\t'redirect_uri' =&gt; APP_CALLBACK\n\t\t);\n\t$back = new Callback(new AuthDaoImpl($_GET['state'],$keys));\n\tif($back-&gt;callback()){\n\t\theader('Location: '.$_GET['state'].'\/wp-admin\/options-general.php?page=weibo-wall');\n\t}\n\texit;\n}\nif($_GET['user']){\n\t$server = new Yar_Server(new API($_GET['user']));\n\ttry{\n\t\t$server-&gt;handle();\n\t}catch(Exception $e){\n\t\techo \"\u611f\u8c22\u60a8\u4f7f\u7528\u5fae\u535a\u5899\uff01\";\n\t}\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>7 \u5ba2\u6237\u7aef\u5e94\u7528\u5165\u53e3<\/h1>\n<p>\u8be5\u5165\u53e3\u5b9e\u4f8b\u5316\u63d2\u4ef6\u5b9e\u4f53\u7c7b\uff0c\u5e76\u4e14\u542f\u7528\u63d2\u4ef6<\/p>\n<pre>$plu = new Plugins(new Dao(get_bloginfo( 'url' )));\n$plu -&gt; run(get_option('weibo_wall'),get_option('weibo_func'));<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>8 \u603b\u7ed3<\/h1>\n<p>\u6574\u4e2a\u8fc7\u7a0b\u5c31\u662f\u8fd9\u6837\uff0c\u4e1a\u52a1\u903b\u8f91\u975e\u5e38\u7b80\u5355\uff0c\u4ee3\u7801\u4e5f\u5f88\u6613\u61c2\u3002\u5728\u4f7f\u7528\u7684\u8fc7\u7a0b\u53d1\u89c9Yar\u771f\u7684\u5f88\u7b80\u5355\u5b9e\u7528\uff0c\u800c\u4e14\u662f\u53ef\u5e76\u884c\u5316\u7684\u3002\u4e0d\u8fc7\u5728\u8fd9\u91cc\u5e76\u6ca1\u6709\u4f53\u73b0\u51fa\u6765\uff0c\u53ef\u4ee5\u518d\u505a\u4e00\u4e9b\u4f18\u5316\u5904\u7406\u3002\u8be5\u63d2\u4ef6\u7684\u5ba2\u6237\u7aef\u4f9d\u8d56\u4e8eYar\u6846\u67b6\uff0c\u8fd9\u662f\u4e00\u4e2a\u57fa\u4e8eC\u8bed\u8a00\u5f00\u53d1\u7684\u62d3\u5c55\u3002\u4f46\u662f\u6ca1\u6709\u8be5\u6846\u67b6\u62d3\u5c55\u4e5f\u6ca1\u5173\u7cfb\uff0c\u6211\u4eec\u5df2\u7ecf\u7ed9\u51fa\u4e86Yar\u7684\u7eafPHP\u5b9e\u73b0\uff0c\u4f60\u5b8c\u5168\u53ef\u4ee5\u4e0d\u53bb\u7406\u4f1a\u8fd9\u4e2a\u5c31\u80fd\u4f7f\u7528\uff0c\u4f46\u8fd8\u662f\u5efa\u8bae\u4f60\u4f7f\u7528Yar\u3002<\/p>\n<p>\u63d2\u4ef6\u5728\u8bbe\u8ba1\u7684\u65f6\u5019\u53ea\u63d0\u4f9b\u4e86\u5f88\u5c11\u7684\u529f\u80fd\uff0c\u4f46\u662f\u6709\u4e9b\u4eba\u9700\u8981\u5176\u4ed6\u7684\u529f\u80fd\uff0c\u90a3\u600e\u4e48\u529e\u5462\uff1f\u8fd9\u65b9\u9762\u6211\u4eec\u4e5f\u662f\u6709\u8003\u8651\uff0c\u6240\u4ee5\u5728\u8bbe\u8ba1\u7684\u65f6\u5019\u8be5\u63d2\u4ef6\u7684\u62d3\u5c55\u6027\u975e\u5e38\u826f\u597d\uff0c\u4e0d\u8fc7\u4f60\u8981\u6709\u4e00\u4e9bPHP\u7f16\u7a0b\u7684\u529f\u5e95\u3002<\/p>\n<p>\u5982\u4f55\u62d3\u5c55\u4ed6\u7684\u529f\u80fd\uff1f<\/p>\n<p>1.\u8054\u7cfb\u4f5c\u8005\uff0c\u544a\u8bc9\u4f60\u9700\u8981\u7684\u529f\u80fd<br \/>2.\u4f5c\u8005\u5f00\u53d1\u76f8\u5e94\u7684\u6570\u636eAPI<br \/>3.\u4f60\u5728\u672c\u5730Dao.class.php\u8c03\u7528API<br \/>4.\u5728Plugins.class.php\u4e2d\u83b7\u53d6\u6570\u636e\u5e76\u6267\u884c\u76f8\u5e94\u4e1a\u52a1\u903b\u8f91<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5206\u4eab\u4e00\u4e2a\u57fa\u4e8eYar\u7684WordPress\u5fae\u535a\u5899\u63d2\u4ef6\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u4e8eYar\u7684WordPress\u5fae\u535a\u5899\u63d2\u4ef6 \u5728\u73b0\u5728\u79fb\u52a8\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u5fae\u535a\u5df2\u7ecf\u6210\u4e3a\u4e86\u6bcf\u4e2a\u4eba\u751f\u6d3b\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e00\u4e2a\u793e\u4ea4\u5de5\u5177\u3002\u800c\/&#8221; target=&#8221;_blank&#8221;&gt;wordpress\u662f\u5168\u4e16\u754c\u6700\u4e3a\u6d41\u884c\u7684\u535a\u5ba2\u7cfb\u7edf\uff0c\u628a\u4f60\u7684\u535a\u5ba2\u63a5\u5165\u65b0\u6d6a\u5fae\u535a\uff0c\u501f\u52a9\u5fae\u535a\u7684\u5f3a\u5927\u7528\u6237\u7fa4\uff0c\u4e0d\u4ec5\u80fd\u7ed9\u4f60\u7684\u7f51\u7ad9\u63d0\u4f9b\u5de8\u5927\u7684\u6d41\u91cf\uff0c\u800c\u4e14\u8fd8\u80fd\u5e26\u6765\u4e0d\u53ef\u4f30\u91cf\u4ef7\u503c\u3002 WordPress\u5fae\u535a\u5899\u5c31\u662f\u8fd9\u6837\u7684\u4e00\u4e2a\u5de5\u5177\uff0c\u8fd9\u4e0d\u662f\u4e00\u6b3e\u666e\u901a\u7684\u63d2\u4ef6\uff0c\u8fd9\u662f\u4e00\u6b3e\u642d\u5efa\u5728SAE\u57fa\u4e8eYar\u7684\u63d2\u4ef6\u3002\u5b83\u975e\u5e38\u7684\u8f7b\u91cf\uff0c\u5b83\u4e0d\u50cf\u5176\u4ed6\u7684\u63d2\u4ef6\u90a3\u6837\uff0c\u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u534e\u4e3d\u5374\u4e0d\u5b9e\u7528\u7684\u529f\u80fd\uff0c\u4e0d\u4ec5\u81c3\u80bf\u800c\u4e14\u62d6\u6162\u901f\u5ea6\u3002\u8fd9\u662f\u4e00\u6b3e\u57fa\u4e8eYar\u7684\u63d2\u4ef6\uff0c\u5e95\u5c42C\u8bed\u8a00\u5f00\u53d1\uff0c\u6027\u80fd\u5353\u8d8a\u3002\u800c\u4e14\u62d3\u5c55\u6027\u5f88\u597d\uff0c\u53ef\u4ee5\u7ed9\u4f60\u63d0\u4f9b\u4e00\u4e0b\u529f\u80fd\uff1a 1.\u4e2a\u4eba\u5fae\u535a\u58992.\u53d1\u5e03\u6587\u7ae0\u540c\u6b65\u5230\u65b0\u6d6a\u5fae\u535a3.\u6587\u7ae0\u8bc4\u8bba\u540c\u6b65\u5230\u65b0\u6d6a\u5fae\u535a\u63a5\u4e0b\u6765\u4ecb\u7ecd\u4e00\u4e0b\u57fa\u672c\u7ed3\u6784\uff1a 1 \u6838\u5fc3\u6570\u636e\u64cd\u4f5c\u7c7b \u8fd9\u4e2a\u7c7b\u5728Dao.class.php\u6587\u4ef6\u4e2d\uff0c\u5b83\u662f\u63d2\u4ef6\u7684\u6838\u5fc3\uff0c\u8d1f\u8d23\u53bb\u670d\u52a1\u7aef\u83b7\u53d6\u6570\u636e \/** * * \u7528\u6237\u6570\u636e\u83b7\u53d6\u7c7b * @author \u590f\u5929 * @date 2015\u5e746\u670828\u65e5 * @site http:\/\/www.xtwind.com * *\/ class Dao{ \/** * \u5fae\u535aRPC\u64cd\u4f5c\u5bf9\u8c61 *\/ private $client; \/** * \u7528\u6237\u6807\u8bc6 *\/ private $mark; \/** * \u6784\u9020\u51fd\u6570\u8bbe\u7f6e\u7528\u6237\u6807\u8bc6 *\/ function __construct($state); \/** * \u8fd4\u56de\u7528\u6237\u6807\u8bc6 *\/ public function getMark(); \/** * \u542f\u7528\u63d2\u4ef6 * @return [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-32015","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/32015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=32015"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/32015\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=32015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=32015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=32015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}