Title: Adding a class to your plugin?
Last modified: September 1, 2016

---

# Adding a class to your plugin?

 *  Resolved [Fact Maven](https://wordpress.org/support/users/factmaven/)
 * (@factmaven)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/adding-a-class-to-your-plugin/)
 * I wanted to know what’s the advantage of adding a `class` structure to your plugin
   rather than just calling the `functions` and when it’s appropriate to use them.

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/adding-a-class-to-your-plugin/#post-7495627)
 * Classes and OO programming tend to keep your codebase “cleaner” and more defined.
   As an example, using a ‘Cart’ class with 15 internal methods for an ecommerce
   site rather then having 15 individual functions spread out in pretty much any
   file you decide to keep them in. There’s also advantages in using inheritance,
   namespacing, etc. Most of the advantages are more to do with ease of programming,
   ease of debugging and ease of upgrades and changes – and almost all of that’s
   for the programmer, not the end-user.
 *  Thread Starter [Fact Maven](https://wordpress.org/support/users/factmaven/)
 * (@factmaven)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/adding-a-class-to-your-plugin/#post-7495715)
 * Makes sense, thanks for the clarification.

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

The topic ‘Adding a class to your plugin?’ is closed to new replies.

## Tags

 * [class](https://wordpress.org/support/topic-tag/class/)
 * [function](https://wordpress.org/support/topic-tag/function/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Fact Maven](https://wordpress.org/support/users/factmaven/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/adding-a-class-to-your-plugin/#post-7495715)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
