0

I have just got into using hooks and have now understand the beauty of them. I understand that I can hook into the following by using add_filter('hook_name','my_hook_name', $variable);

function a_function($variable){
    return add_filter('hook_name', $variable);
}

But what if your the function you wanted to hook into simply returned a variable.

function a_function($variable){
    return $variable
}

I don't have the 'hook_name' to hook into anymore. So am I missing something? How can I edit that second function via my functions.php?

3

You cannot hook in a function without a hook. If it returns a variable, you will have to use it as it is returned. And then, maybe, perform your operations on that.

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.