TYPECHO WIKI
每一个作品都值得被记录

Typecho 官方文档开发接口介绍

Typecho维基君Typecho教程 • 861次浏览 • 发布 2023-03-23 • 更新 2023-03-23

官方开发文档实在是太潦草了

Widget_Archive

接口参数描述
indexHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问最近文章首页以及分页时被触发
error404Handle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问404页面时被触发
singleHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问单独页面时被触发(文章,页面,附件)
categoryHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问按分类归档页面时被触发
tagHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问按标签归档页面时被触发
authorHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问按作者归档页面时被触发
dateHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问按日期归档页面时被触发
search$keywords 搜索关键词$archive Widget_Archive对象这是一个独占接口,当访问搜索页面时被触发 当这个接口被实现后,系统自己的搜索动作将不会继续,你需要在这个接口内自己push搜索的数据到Widget_Archive对象 此接口多用于自己实现站内搜索来替换默认的
searchHandle$archive Widget_Archive对象$select Typecho_Db_Query对象当访问搜索页面时被触发
query$archive Widget_Archive对象$select Typecho_Db_Query对象Widget_Archive所有的数据库查询动作最终将由一个query方法来执行 此接口在query方法内,多用于hack某些查询语句
select$archive Widget_Archive对象
handleInit$archive Widget_Archive对象$select Typecho_Db_Query对象
handletype $archive Widget_Archive对象$select Typecho_Db_Query对象
pageNavcurrentPage $total pageSize $prev $next $splitPage $splitWord
headerOptions$allows $archive Widget_Archive对象
header$header $archive Widget_Archive对象首页与文章页头部
footer$archive Widget_Archive对象首页与文章页脚部
beforeRender$archive Widget_Archive对象
afterRender$archive Widget_Archive对象
commentFeedItemfeedType $comments
feedItemfeedType $archive Widget_Archive对象

Widget_Feedback

接口参数描述
comment$comment content
finishComment$feedback Widget_Feedback对象
trackback$trackback content
finishTrackback$feedback Widget_Feedback对象评论成功时触发

Widget_Login

接口参数描述
loginFailuser name password remember
loginSucceeduser name password remember

Widget_Logout

接口参数描述
logout

Widget_Register

接口参数描述
register$dataStruct
finishRegister$register Widget_Register对象

Widget_Upload

接口参数描述
beforeUpload$result
upload$upload Widget_Upload对象
beforeModify$result
modify$upload Widget_Upload对象

Widget_User

接口参数描述
login$name $password $temporarily $expire
hashValidate$password $user['password']
loginSucceed$user Widget_User对象$name $password $temporarily $expire
loginFail$user Widget_User对象$name $password $temporarily $expire
logout

Widget_XmlRpc

接口参数描述
textFilter$input['text'] $xmlRpc Widget_XmlRpc对象
upload$xmlRpc Widget_XmlRpc对象
pingback$pingback $post
finishPingback$xmlRpc Widget_XmlRpc对象

Widget_Abstract_Comments

接口参数描述
content$text $comments Widget_Abstract_Comments对象以下句柄同样具有此接口: Widget_Feedback Widget_Comments_Admin Widget_Comments_Archive Widget_Comments_Edit Widget_Comments_Ping Widget_Comments_Recent
contentEx$text $comments Widget_Abstract_Comments对象以下句柄同样具有此接口: Widget_Feedback Widget_Comments_Admin Widget_Comments_Archive Widget_Comments_Edit Widget_Comments_Ping Widget_Comments_Recent
filter$value $comments Widget_Abstract_Comments对象以下句柄同样具有此接口: Widget_Feedback Widget_Comments_Admin Widget_Comments_Archive Widget_Comments_Edit Widget_Comments_Ping Widget_Comments_Recent
gravatar$size $rating $default $comments Widget_Abstract_Comments对象以下句柄同样具有此接口: Widget_Feedback Widget_Comments_Admin Widget_Comments_Archive Widget_Comments_Edit Widget_Comments_Ping Widget_Comments_Recent
autoP$text以下句柄同样具有此接口: Widget_Feedback Widget_Comments_Admin Widget_Comments_Archive Widget_Comments_Edit Widget_Comments_Ping Widget_Comments_Recent
markdown$text以下句柄同样具有此接口: Widget_Feedback Widget_Comments_Admin Widget_Comments_Archive Widget_Comments_Edit Widget_Comments_Ping Widget_Comments_Recent

Widget_Abstract_Contents

接口参数描述
excerpttext $contents Widget_Abstract_Contents对象以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
excerptEx$excerpt $contents Widget_Abstract_Contents对象以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
contenttext $contents Widget_Abstract_Contents对象以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
contentEx$content $contents Widget_Abstract_Contents对象以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
isFieldReadOnly$name以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
filter$value $contents Widget_Abstract_Contents对象以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
titletitle $contents Widget_Abstract_Contents对象以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
autoP$text以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author
markdown$text以下句柄同样具有此接口: Widget_Archive Widget_Upload Widget_XmlRpc Widget_Contents_Related Widget_Contents_Attachment_Admin Widget_Contents_Attachment_Related Widget_Contents_Attachment_Unattached Widget_Contents_Page_List Widget_Contents_Post_Admin Widget_Contents_Page_Admin Widget_Contents_Post_Edit Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit Widget_Contents_Post_Recent Widget_Contents_Related_Author

Widget_Abstract_Metas

接口参数描述
filter$value $metas Widget_Abstract_Metas对象以下句柄同样具有此接口: Widget_Metas_Category_Edit Widget_Metas_Category_List Widget_Metas_Category_Admin Widget_Metas_Tag_Cloud Widget_Metas_Tag_Admin Widget_Metas_Tag_Edit

Widget_Abstract_Users

接口参数描述
filter$value $users Widget_Abstract_Users对象以下句柄同样具有此接口: Widget_Login Widget_Logout Widget_Register Widget_Users_Admin Widget_Users_Author Widget_Users_Edit Widget_Users_Profile

Widget_Comments_Archive

接口参数描述
listCommentssingleCommentOptions $archive Widget_Comments_Archive对象
reply$word $archive Widget_Comments_Archive对象
cancelReply$word $archive Widget_Comments_Archive对象

Widget_Comments_Edit

接口参数描述
mark$comment $edit Widget_Comments_Edit对象$status
delete$comment $edit Widget_Comments_Edit对象
finishDelete$comment $edit Widget_Comments_Edit对象
edit$comment $edit Widget_Comments_Edit对象
finishEdit$edit Widget_Comments_Edit对象
comment$comment $edit Widget_Comments_Edit对象
finishComment$edit Widget_Comments_Edit对象

Widget_Contents_Attachment_Edit

接口参数描述
delete$post $edit Widget_Contents_Attachment_Edit对象
finishDelete$post $edit Widget_Contents_Attachment_Edit对象
delete$post $edit Widget_Contents_Attachment_Edit对象
finishDelete$post $edit Widget_Contents_Attachment_Edit对象

Widget_Contents_Page_Edit

接口参数描述
write$contents $edit Widget_Contents_Page_Edit对象
finishPublish$contents $edit Widget_Contents_Page_Edit对象
finishSave$contents $edit Widget_Contents_Page_Edit对象
delete$page $edit Widget_Contents_Page_Edit对象
finishDelete$page $edit Widget_Contents_Page_Edit对象

Widget_Contents_Post_Edit

接口参数描述
getDefaultFieldItems$layout以下句柄同样具有此接口: Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit
write$contents $edit Widget_Contents_Post_Edit对象以下句柄同样具有此接口: Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit
finishPublish$contents $edit Widget_Contents_Post_Edit对象以下句柄同样具有此接口: Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit
finishSave$contents $edit Widget_Contents_Post_Edit对象以下句柄同样具有此接口: Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit
delete$post $edit Widget_Contents_Post_Edit对象以下句柄同样具有此接口: Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit
finishDelete$post $edit Widget_Contents_Post_Edit对象以下句柄同样具有此接口: Widget_Contents_Attachment_Edit Widget_Contents_Page_Edit

Widget_Metas_Category_List

接口参数描述
listCategoriescategoryOptions $list Widget_Metas_Category_List对象以下句柄同样具有此接口: Widget_Metas_Category_Admin
广告声明:文内含有的对外跳转链接(包括不限于超链接、二维码、口令等形式),用于传递更多信息,节省甄选时间,结果仅供参考,Typecho.Wiki所有文章均包含本声明。
厂商投放

【腾讯云】🎉五一云上盛惠!云服务器99元/月续费同价!

腾讯云五一劳动节海量产品 · 轻松上云!云服务器首年1.8折起,买1年送3个月!超值优惠,性能稳定,让您的云端之旅更加畅享。快来腾讯云选购吧!

广告
添加新评论 »