This is the old revision of this document!
Plug in interface and function list
In Typecho, as long as this class inherits from the Typecho_Widget base class, it has this plug-in interface by default. Interface developers can use this interface to seamlessly inject methods into the current class
For example, if I want to add a method to the Widget_Archive class to obtain the number of characters in the current article (charactersNum), just declare it in your plug-in 'activate' method
Typecho_Plugin :: factory ( 'Widget_Archive' ) -> ___charactersNum = array ( 'MyPlugin' , 'charactersNum' ) ;
Notice that we prefix the method name with three underscores to indicate that this is an internal method. The implementation of this method is also very simple, because the system will pass the current object to you as a parameter
public static function charactersNum ( $archive )
{
return mb_strlen ( $archive -> text , 'UTF-8' ) ;
}
Then this method has been embedded in Widget_Archive. You can directly call the following code in the template to output it
<? php $this -> charactersNum ( ) ; ?>
Handle interface
Interface |
parameter |
describe |
indexHandle |
Widget_Archive object
$select |
|
error404Handle |
Widget_Archive object
$select |
|
singleHandle |
Widget_Archive object
$select |
|
categoryHandle |
Widget_Archive object
$select |
|
tagHandle |
Widget_Archive object
$select |
|
authorHandle |
Widget_Archive object
$select |
|
dateHandle |
Widget_Archive object
$select |
|
search |
$keywords
Widget_Archive object |
|
searchHandle |
Widget_Archive object
$select |
|
query |
Widget_Archive object
$select |
|
select |
Widget_Archive object |
|
handleInit |
Widget_Archive object
$select |
|
handle |
$parameter->type
Widget_Archive object
$select |
|
pageNav |
$currentPage
$total
$parameter->pageSize
$prev
$next
$splitPage
$splitWord |
|
headerOptions |
$allows
Widget_Archive object |
|
header |
$header
Widget_Archive object |
|
footer |
Widget_Archive object |
|
beforeRender |
Widget_Archive object |
|
afterRender |
Widget_Archive object |
|
commentFeedItem |
$feedType
$comments |
|
feedItem |
$feedType
Widget_Archive object |
|
Interface |
parameter |
describe |
comment |
$comment
$content |
|
finishComment |
Widget_Feedback object |
|
trackback |
$trackback
$content |
|
finishTrackback |
Widget_Feedback object |
|
Interface |
parameter |
describe |
loginFail |
$user
$request->name
$request->password
1 == $request->remember |
|
loginSucceed |
$user
$request->name
$request->password
1 == $request->remember |
|
Interface |
parameter |
describe |
logout |
nothing
|
|
Interface |
parameter |
describe |
register |
$dataStruct |
|
finishRegister |
Widget_Register object |
|
Interface |
parameter |
describe |
beforeUpload |
$result |
|
upload |
Widget_Upload object |
|
beforeModify |
$result |
|
modify |
Widget_Upload object |
|
Interface |
parameter |
describe |
login |
$name
$password
$temporarily
$expire |
|
hashValidate |
$password
$user['password'] |
|
loginSucceed |
Widget_User object
$name
$password
$temporarily
$expire |
|
loginFail |
Widget_User object
$name
$password
$temporarily
$expire |
|
logout |
nothing
|
|
Interface |
parameter |
describe |
textFilter |
$input['text']
Widget_XmlRpc object |
|
upload |
Widget_XmlRpc object |
|
pingback |
$pingback
$post |
|
finishPingback |
Widget_XmlRpc object |
|
Interface |
parameter |
describe |
content |
$text
Widget_Abstract_Comments object |
The following handles also have this interface:
Widget_Feedback
Widget_Comments_Admin
Widget_Comments_Archive
Widget_Comments_Edit
Widget_Comments_Ping
Widget_Comments_Recent |
contentEx |
$text
Widget_Abstract_Comments object |
The following handles also have this interface:
Widget_Feedback
Widget_Comments_Admin
Widget_Comments_Archive
Widget_Comments_Edit
Widget_Comments_Ping
Widget_Comments_Recent |
filter |
$value
Widget_Abstract_Comments object |
The following handles also have this interface:
Widget_Feedback
Widget_Comments_Admin
Widget_Comments_Archive
Widget_Comments_Edit
Widget_Comments_Ping
Widget_Comments_Recent |
gravatar |
$size
$rating
$default
Widget_Abstract_Comments object |
The following handles also have this interface:
Widget_Feedback
Widget_Comments_Admin
Widget_Comments_Archive
Widget_Comments_Edit
Widget_Comments_Ping
Widget_Comments_Recent |
autoP |
$text |
The following handles also have this interface:
Widget_Feedback
Widget_Comments_Admin
Widget_Comments_Archive
Widget_Comments_Edit
Widget_Comments_Ping
Widget_Comments_Recent |
markdown |
$text |
The following handles also have this interface:
Widget_Feedback
Widget_Comments_Admin
Widget_Comments_Archive
Widget_Comments_Edit
Widget_Comments_Ping
Widget_Comments_Recent |
Widget_Abstract_Contents
Interface |
parameter |
describe |
excerpt |
$text
Widget_Abstract_Contents object |
The following handles also have this interface:
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
Widget_Abstract_Contents object |
The following handles also have this interface:
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 |
content |
$text
Widget_Abstract_Contents object |
The following handles also have this interface:
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
Widget_Abstract_Contents object |
The following handles also have this interface:
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 |
The following handles also have this interface:
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
Widget_Abstract_Contents object |
The following handles also have this interface:
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 |
title |
$title
Widget_Abstract_Contents object |
The following handles also have this interface:
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 |
The following handles also have this interface:
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 |
The following handles also have this interface:
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 |
Interface |
parameter |
describe |
filter |
$value
Widget_Abstract_Metas object |
The following handles also have this interface:
Widget_Metas_Category_Edit
Widget_Metas_Category_List
Widget_Metas_Category_Admin
Widget_Metas_Tag_Cloud
Widget_Metas_Tag_Admin
Widget_Metas_Tag_Edit |
Interface |
parameter |
describe |
filter |
$value
Widget_Abstract_Users object |
The following handles also have this interface:
Widget_Login
Widget_Logout
Widget_Register
Widget_Users_Admin
Widget_Users_Author
Widget_Users_Edit
Widget_Users_Profile |
Interface |
parameter |
describe |
listComments |
$singleCommentOptions
Widget_Comments_Archive object |
|
reply |
$word
Widget_Comments_Archive object |
|
cancelReply |
$word
Widget_Comments_Archive object |
|
Interface |
parameter |
describe |
mark |
$comment
Widget_Comments_Edit object
$status |
|
delete |
$comment
Widget_Comments_Edit object |
|
finishDelete |
$comment
Widget_Comments_Edit object |
|
edit |
$comment
Widget_Comments_Edit object |
|
finishEdit |
Widget_Comments_Edit object |
|
comment |
$comment
Widget_Comments_Edit object |
|
finishComment |
Widget_Comments_Edit object |
|
Widget_Contents_Attachment_Edit
Interface |
parameter |
describe |
delete |
$post
Widget_Contents_Attachment_Edit object |
|
finishDelete |
$post
Widget_Contents_Attachment_Edit object |
|
delete |
$post
Widget_Contents_Attachment_Edit object |
|
finishDelete |
$post
Widget_Contents_Attachment_Edit object |
|
Widget_Contents_Page_Edit
Interface |
parameter |
describe |
write |
$contents
Widget_Contents_Page_Edit object |
|
finishPublish |
$contents
Widget_Contents_Page_Edit object |
|
finishSave |
$contents
Widget_Contents_Page_Edit object |
|
delete |
$page
Widget_Contents_Page_Edit object |
|
finishDelete |
$page
Widget_Contents_Page_Edit object |
|
Widget_Contents_Post_Edit
Interface |
parameter |
describe |
getDefaultFieldItems |
$layout |
The following handles also have this interface:
Widget_Contents_Attachment_Edit
Widget_Contents_Page_Edit |
write |
$contents
Widget_Contents_Post_Edit object |
The following handles also have this interface:
Widget_Contents_Attachment_Edit
Widget_Contents_Page_Edit |
finishPublish |
$contents
Widget_Contents_Post_Edit object |
The following handles also have this interface:
Widget_Contents_Attachment_Edit
Widget_Contents_Page_Edit |
finishSave |
$contents
Widget_Contents_Post_Edit object |
The following handles also have this interface:
Widget_Contents_Attachment_Edit
Widget_Contents_Page_Edit |
delete |
$post
Widget_Contents_Post_Edit object |
The following handles also have this interface:
Widget_Contents_Attachment_Edit
Widget_Contents_Page_Edit |
finishDelete |
$post
Widget_Contents_Post_Edit object |
The following handles also have this interface:
Widget_Contents_Attachment_Edit
Widget_Contents_Page_Edit |
Interface |
parameter |
describe |
listCategories |
$categoryOptions
Widget_Metas_Category_List object |
The following handles also have this interface:
Widget_Metas_Category_Admin |