p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional WordPress Plugin Development (http://p2p.wrox.com/book-professional-wordpress-plugin-development-628/)
-   -   Chapter 3 - Hooks within a class. add_action (http://p2p.wrox.com/book-professional-wordpress-plugin-development/94272-chapter-3-hooks-within-class-add_action.html)

Sausage March 18th, 2015 01:52 PM

Chapter 3 - Hooks within a class. add_action
 
Hi, I am new to all of this, but not new to coding or software engineering. I have to agree with the books opening comments - "It can be a challenge to find resources in a single place". Hence I am reading this book.

Background to my question:
On page 31 add_action is define as taking 4 parameters. The second parameter is "$function" - "The name of your function that wordpress calls".

My question: Using Hooks from within a class uses the following example:

<? php
add_action ( $tag ,$function_to_add );
?>

So why is the example using the $function_to_add - this is core wordpress function and an alias for "add_filter()".

Is there something I do not understand, or was this just an accident that the example on page 51 calls core functionality when it should be referring to my own function that "I want to add"?

Thanks
Mark


All times are GMT -4. The time now is 02:34 PM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.