In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Typecho plug-in how to write plug-in mount code, in view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Finally, after we are able to save the configuration information, we can begin to write the mount function of the plug-in.
First of all, we need to know that the system has reserved plug-in points for us in all key links. When the system runs to the plug-in point, it will detect whether there is a plug-in hanging on this point, and then execute the logic of the plug-in!
The job of the plug-in is to find the right plug-in point, hang it, and execute its own logic.
Plug-in point, plug-in hook, plug-in interface. It's a concept here in Lao Gao.
Official plug-in interface and feature list
The logic that our plug-in needs to execute is here, the finishPublish method of the Widget_Contents_Post_Edit class
As you can see in the file path var/Widget/Contents/Post/Edit.php:736, the interface passes us two parameters, one is the published content, and the other is the class itself. With the class itself, we can call its public methods at will in the plug-in!
The copy code is as follows:
/ / the article completes the release plug-in interface
$this- > pluginHandle ()-> finishPublish ($contents, $this)
There is also a page publishing interface, which is mentioned in the following code.
How to mount
The code is as follows, with omission.
The copy code is as follows:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.