Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 Application Class zmanc BOOK: Professional Android 2 Application Development 0 December 14th, 2010 02: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



All times are GMT -4. The time now is 09:50 AM.


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