Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
That's what I feared. Ok thanks for clarifying. –  Graeme Mar 6 '13 at 11:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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