Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsq_can_load filter does not support multiple callbacks #74

Open
aaemnnosttv opened this issue Jul 5, 2019 · 0 comments
Open

dsq_can_load filter does not support multiple callbacks #74

aaemnnosttv opened this issue Jul 5, 2019 · 0 comments

Comments

@aaemnnosttv
Copy link

Currently, the dsq_can_load does not support multiple callbacks on it as the $script_name will be lost with the first callback that returns anything other that $script_name.

$site_allows_load = apply_filters( 'dsq_can_load', $script_name );
if ( is_bool( $site_allows_load ) ) {
return $site_allows_load;
}

In order to ensure $script_name is available to all callbacks, it must be passed as a secondary parameter and use the first as the default return value.

E.g.

apply_filters( 'dsq_can_load', true, $script_name )

Unfortunately, this would be a breaking change to the way it is currently.

Is this something the maintainers are aware of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant