4

How to use Oriented Object concept in add_filter or add_action with priority and number of parameters?

This is possible without additional parameters:

add_filter('wp_get_attachment_image_src', array($this, 'useCDN');

With parameters this is possible? How to?

7

It's done the same way you would do in procedural, you need to provide the priority and the number of parameters

so you would have;

add_filter('wp_get_attachment_image_src', array($this, 'useCDN'), 10, 3);

to pass 3 additional parameters to the filter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.