Home > Chỉ dẫn lập trình > How to write a simple WordPress Plugin

How to write a simple WordPress Plugin

Create new text file: simple-plugin.php
Enter following content:

This entry is posted by XXX – Thank you for reading’;
}

add_filter(‘the_content’, ‘modifyPostContent’);

Zip it and upload to server to install new plugin. Access your single page and see at end of post.

If you want to use class, you change your code

class YourClassName {
function modifyPostContent($content) {
return $content . ‘
This entry is posted by XXX – Thank you for reading’;
}
}

add_filter(‘the_content’, array(‘YourClassName’, ‘modifyPostContent’));

Content (You can use Yahoo! Messenger Emoticons :D = smile)
Captcha