init.php 506 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class Example_Article extends Plugin {
  3. private $host;
  4. function about() {
  5. return array(1.0,
  6. "Example plugin for HOOK_RENDER_ARTICLE",
  7. "fox",
  8. true);
  9. }
  10. function init($host) {
  11. $this->host = $host;
  12. $host->add_hook($host::HOOK_RENDER_ARTICLE, $this);
  13. }
  14. function get_prefs_js() {
  15. return file_get_contents(dirname(__FILE__) . "/init.js");
  16. }
  17. function hook_render_article($article) {
  18. $article["content"] = "Content changed: " . $article["content"];
  19. return $article;
  20. }
  21. }
  22. ?>