You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a plugin that hook into 'shunt_add_new_link' and I was wondering if there was a good way to bypass all the filters after executing once, so I can return yourls_add_new_link ($url) without running my filter twice.
I tried to remove all filters just before returning, like: yourls_remove_all_filters('shunt_add_new_link') but that way php hangs and times out.
So I'm checking for a constant that I define just before returning. It works for this plugin, but other plugins that hook into shunt_add_new_link continue to run twice. So, do anybody know why my script hangs if I 'remove_all_filters'? The only solution I'm seeing is checking for my constant on every plugin that use this hook...
It would be much better if I could just remove the filters after running them one time, so I could put a very high priority in this filter for it to run last and it would remove everything after running once...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm writing a plugin that hook into 'shunt_add_new_link' and I was wondering if there was a good way to bypass all the filters after executing once, so I can
return yourls_add_new_link ($url)
without running my filter twice.I tried to remove all filters just before returning, like:
yourls_remove_all_filters('shunt_add_new_link')
but that way php hangs and times out.So I'm checking for a constant that I define just before returning. It works for this plugin, but other plugins that hook into shunt_add_new_link continue to run twice. So, do anybody know why my script hangs if I 'remove_all_filters'? The only solution I'm seeing is checking for my constant on every plugin that use this hook...
It would be much better if I could just remove the filters after running them one time, so I could put a very high priority in this filter for it to run last and it would remove everything after running once...
Beta Was this translation helpful? Give feedback.
All reactions