Title: add_filter in wordpress oop plugin
Last modified: August 21, 2016

---

# add_filter in wordpress oop plugin

 *  [girll](https://wordpress.org/support/users/girll/)
 * (@girll)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/add_filter-in-wordpress-oop-plugin/)
 * HI all. I am writing a wordpress plugin with OOP techniques. I need to add filter.
   I write it so:
 * `add_filter('the_content', array($myObject, 'display_products'));`
 * But in that case it starts to load page without end.
    How should I write it right?
   Thanks!

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/add_filter-in-wordpress-oop-plugin/#post-4001429)
 * Depending on the context from which you add the filter, what you have may be 
   correct. Perhaps there is a flaw in your display_products() method?

Viewing 1 replies (of 1 total)

The topic ‘add_filter in wordpress oop plugin’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/add_filter-in-wordpress-oop-plugin/#post-4001429)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
