What does apply_filters do?

I have a scenario like this , since its a big code, I’m asking this in an easy way:

In a file called One.php, I have something like this:

Read More
add_filter('eshopaddtocheckout','eshop_extras_checkout');

function eshop_extras_checkout($echo){
    //blah blah..   
}

In a file, Two.php, I have something like this:

$echo = apply_filters('eshopaddtocheckout',$echo);

My doubts are:

  1. I don’t understood how Two.php made a connection with the One.php file? I didnt even find a line using something like include One.php inside the Two.php file (BUT the functionality is working perfectly between the 2 files)

  2. what does apply_filters do?

Related posts

Leave a Reply

3 comments