Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional WordPress Plugin Development
This is the forum to discuss the Wrox book Professional WordPress Plugin Development by Brad Williams, Ozh Richard, Justin Tadlock; ISBN: 978-0-470-91622-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional WordPress Plugin Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 18th, 2015, 12:52 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 Application Class zmanc BOOK: Professional Android 2 Application Development 0 December 14th, 2010 03:35 PM
Getting "Hooks.pm not found" error jromeirojr Perl 1 May 28th, 2007 06:39 AM
Help needed for Windows Hooks (Global Mouse Hooks) effone Visual C++ 0 October 2nd, 2006 03:28 PM
Kernel Hooks J-Rod Need help with your homework? 0 August 30th, 2006 02:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.