Linked Questions

77 votes
9 answers
68k views

remove_action or remove_filter with external classes?

In a situation where a plugin has encapsulated its methods within a class and then registered a filter or action against one of those methods, how do you remove the action or the filter if you no ...
Tom Auger's user avatar
  • 7,066
23 votes
1 answer
2k views

How to create an API for my plugin?

I have been developing plugins for WordPress, most plugins I have developed use two or three classes, hence not as huge as Buddypress or WooCommerce. I am planning to develop two open source plugins ...
pixelngrain's user avatar
  • 1,400
16 votes
3 answers
20k views

PHP error with shortcode handler from a class

Currently i am using the following generic flow for adding the shortcode for a plugin. class MyPlugin { private $myvar; function baztag_func() { print $this->myvar; ...
xmaestro's user avatar
  • 265
13 votes
4 answers
6k views

Remove Actions/Filters added via Anonymous Functions

That's a freaking bad practice I must say. Spent last two hours finding a solution to remove actions and filters added via Anonymous functions. This is the code used on a Parent Theme, and I need ...
Abhik's user avatar
  • 2,911
13 votes
2 answers
24k views

Use wp init hook to call other hooks?

I want to know if it is a good practice according to WordPress theme or plugin development. add_action('init','all_my_hooks'); function all_my_hooks(){ // some initialization stuff here and then ...
atinder's user avatar
  • 233
5 votes
3 answers
11k views

Removing an action from an external plugin class

I am using a plugin that has this line of code to add an action from the Eazyest_Frontend class: add_action( 'eazyest_gallery_thumbnails', 'ezg_thumbnails',5); I want to remove that and do something ...
Steve's user avatar
  • 153
5 votes
2 answers
226 views

Migrating Markdown (from Drupal)

I'm in the process of migrating my blog from Drupal to Wordpress. I have made liberal use of Markdown in the original posts (and Geshi syntax highlighting). In see that the WP-Markdown plugin ...
Martin Thompson's user avatar
5 votes
1 answer
361 views

Update a Plugin while maintaining back compatibility: general

How can I make updates a public plugin of mine without breaking the plugin for all existing users. Firstly, I'd like to change the main plugin's class/namespace, because I'd like it to be similar ...
helgatheviking's user avatar
4 votes
1 answer
2k views

How to display random users with avatars

I adapted a little a function to display a number of random users with their avatars with a shortcode. It works, but something is not good. Sometimes it displays with one user less than I want (just a ...
Yuri's user avatar
  • 1,121
4 votes
5 answers
941 views

How do I Make a Theme "plugin-ready"?

How do I revise a theme so that I can publish my event hooks and anyone can build a plugin to add new functionality easily to my theme?
Volomike's user avatar
  • 1,855
2 votes
2 answers
444 views

WordPress classes explained

Are there any books, websites or lectures that explain the built-in WordPress classes? I would really like to learn how WordPress works internally. I've dug up the core files on trac and even went ...
Siddharth Thevaril's user avatar
2 votes
1 answer
1k views

Using a front controller in a Wordpress plugin, any suggestions?

My idea was to use a front controller in our plugin. has anyone done that already? The responsibilities of the controller should be initiate router class; provide access to objects registry, which ...
Nicola Peluchetti's user avatar
2 votes
2 answers
2k views

Hooking Into Widget Output Loop

When wordpress sidebar outputs any particular registered sidebar it loop through all widgets that assigned through it and outputs it (i guess). Is is possible to hook into the loop and add some ...
Sisir's user avatar
  • 7,772
2 votes
1 answer
3k views

Dashes instead of slashes as permalink structure separator

I have a weird problem created by a bad requirement. (I say this because a lot of comments telling me this is a bad thing to want to do are not helpful. I know. I don't want to do it.) Is it possible ...
Adam Michael Wood's user avatar
2 votes
1 answer
428 views

Stop parsing shortcodes

I'd like to stop parsing shortcodes in the_content but I'm struggling to find what the correct filter would be. This didn't work: remove_filter( 'the_content', 'do_shortcode', 40 ); remove_filter( '...
Atadj's user avatar
  • 2,162

15 30 50 per page