Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLuke Lee
7,577 PointsWants to learn add_filter function in wordpress & woocommerce
Hey, Zac: Thank you very much for teaching us all the wordpress knowledge. It would be a lot harder to learn wordpress without your videos. I am learning woocommerce recently, and find it is very different to other open source platforms. We use add_action and remove_action to modify small layout changes. And we use add_filter to modify the functions. I just couldn't get my head around this add_filter. I am not sure if it is just me. If possible, can we have a class for this add_filter?
Many thanks
2 Answers
Ryan Duchene
Courses Plus Student 46,022 PointsFilters still elude me to some extent. I have actions down, but filters are a little harder to grasp. I found a great article on them, though. Maybe that will help you some.
Zac Gordon
Treehouse Guest TeacherHey Luke!
Have you watched the plugin course yet? We get into a good bit of detail on this.
Also, in the Ecommerce course up on the roadmap we have a whole stage dedicated to all the actions and filters built into WooCommerce so you should walk away from that with a real solid understanding :)
Luke Lee
7,577 PointsHi Zac:
I have gone through these tutorial.
Still a bit confusing. For example.
function custom_excerpt_more ($more){
return '';
}
add_filter('');
What is $more? I understand it is an object, but where do I get the object name? Sometimes, I see 2 objects in the brakets, what are they?
Luke Lee
7,577 PointsLuke Lee
7,577 PointsGreat, Thank you for the information.