0
votes
1answer
30 views

Plugin default settings hook

I am writing a plugin where I want it's default settings to change in accordance to the theme that is selected. I have it working, but would rather provide an action hook for this instead of writing ...
0
votes
1answer
83 views

Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like do_action('my-hook-name'); inside a call to add_action();? I'm aware this code doesn't work, but I was thinking something along the lines of... ...
0
votes
0answers
8 views

Is it possible to pass custom args to action/filter callback functions? [duplicate]

I am filtering the Where clause with the filter hook "posts_where" and I would like to pass a custom argument to the callback function. Because I don't know how to do that yet, I am adding the filter ...
0
votes
2answers
194 views

Filter an array with a callback - for single & multidimensional arrays

I've a filter attached, that allows modifying an array: $data = apply_filters( 'wpse_example_filter', $data ); The problem is, that the data can be a single or multidimensional array: // single: ...
6
votes
2answers
262 views

current_shortcode() - detect currently used shortcode

In a plugin class I want to provide simple fields for public data: email, phone number, Twitter etc. The list can be extended. See the plugin Public Contact Data on GitHub for details. To keep the ...