Title: Oddities about the class based plugin tutorial
Last modified: August 21, 2016

---

# Oddities about the class based plugin tutorial

 *  [Rod Roark](https://wordpress.org/support/users/sunsetsystems/)
 * (@sunsetsystems)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/oddities-about-the-class-based-plugin-tutorial/)
 * In my attempts to learn plugin development I have been going through the “class
   based” sample here:
 * [http://www.yaconiello.com/blog/how-to-write-wordpress-plugin/](http://www.yaconiello.com/blog/how-to-write-wordpress-plugin/)
 * One thing I don’t understand is, why are the WP_Plugin_Template and WP_Plugin_Template_Settings
   classes instantiated at all? They have no member variables, so it seems the instances
   have no practical value and the class functions may as well all be static. Are
   there situations where they might have variables?
 * Also the call to do_settings_fields() in templates/settings.php seems to be a
   mistake. It doesn’t do anything and is missing the required second argument.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/oddities-about-the-class-based-plugin-tutorial/#post-4611352)
 * I’m assuming they are just example empty class frameworks that you are expected
   to elaborate on based on your specific needs, or that you do so by extending 
   the base class. Since the point is how to make a class based plugin and not how
   to make a functional class that does something useful, the extra properties may
   have been thought to just confuse the issue, except in your case where the lack
   of properties was confusing 🙂
 * You’re right about the settings fields. Typically, one shouldn’t even be calling
   that function, all the fields can be done at once with `do_settings_sections()`.
   Sigh. Such is the nature of information on the Internet. Everything must be viewed
   with a critical eye, all data is suspect, even the Codex, and even this post!
   You will eventually recognize authors whose information you trust and always 
   go to them when possible.
 *  Thread Starter [Rod Roark](https://wordpress.org/support/users/sunsetsystems/)
 * (@sunsetsystems)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/oddities-about-the-class-based-plugin-tutorial/#post-4611356)
 * Thanks bcworkz, that’s about what I figured. If anyone has other simple examples
   of object oriented plugins I’d love to look at those also.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Oddities about the class based plugin tutorial’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Rod Roark](https://wordpress.org/support/users/sunsetsystems/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/oddities-about-the-class-based-plugin-tutorial/#post-4611356)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
