Linked Questions

0 votes
0 answers
368 views

Override an advanced custom fields action callback [duplicate]

I'm in the process of writing a CDN plugin for WordPress and am trying to integrate it with the Advanced Custom Fields plugin. I need to filter the output of the "File" field type on the edit post ...
Andy's user avatar
  • 1,027
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
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
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
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
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
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
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
2 votes
2 answers
446 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
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
1 vote
2 answers
4k views

How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?

Is there any way to change the order of filters for e.g. the_content before they are applied? What I currently have is the following ideas: /** * Print all filters for some hook. */ function ...
Blackbam's user avatar
  • 545
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
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
0 votes
1 answer
2k views

remove_action not removing add_action from constructor

I am trying to replace a message from a function that got hooked in a constructor from a class from woocommerce. This is what I tried to remove the message: What I tried. function remove_actions() {...
Adrian's user avatar
  • 113
0 votes
1 answer
2k views

remove_action not working, even after changing priority [duplicate]

So one of the functions in my theme is: public function job_manager_job_filters_distance() { //Show some HTML } And somewhere else in the document lies: add_action( '...
Django's user avatar
  • 13
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
1 vote
3 answers
893 views

Registering and using actions which return results in a Plugin class

I have a plugin class which contains a function spektrix_list_events() class SpektrixPlugin { public function __construct(){ add_action( 'init', array ( $this, 'init' )); } ...
codecowboy's user avatar
  • 1,768
2 votes
2 answers
875 views

Using has_filter with a class based plugin to check whether the plugin is active or not

Usually I use this method to test whether a plugin is active (usually my own). This would be in the plugin I'm checking for: function my_plugin_setup() { // setup code here } add_action( '...
Andrew's user avatar
  • 1,163
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
-1 votes
1 answer
755 views

How To Remove The Filter That Adds JetPack Related Content To Dom [closed]

I am trying to remove the filter in JetPack's Related Posts module that adds the element to the DOM that the module's JavaScript populates with the related posts. Once I remove it, I can achieve my ...
JPollock's user avatar
  • 1,248
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
0 votes
2 answers
277 views

Removing a Filter

I'm using 'Simply Show Hooks' plugin to spot various filters on a page. I'm trying to remove the following filter's function (method): UM_User_posts–>add_tab Here's my remove_filter code so far: ...
Richard's user avatar
  • 161
0 votes
0 answers
279 views

Remove action added from class

This has been asked before and I know how to do this but im having trouble removing a specific action added by the easy columns plugin. The action is added similar to below: class EasyColumns { ...
David's user avatar
  • 123