Jump to content

Accessing hook parameters


finedesignz

Recommended Posts

Hi,

 

I know this is a newbie question, but I have searched the forum for a while and need a little boost.

 

Why can I not get this action hook to work?

 

<?php

function example($params)
{
   echo "<pre>";
   echo("Domain is: " .$params[0]['params']['domains']);    // gives me "Domain is:"
   echo"</pre>";
}
add_hook("AfterModuleCreate",50,"example");

?>

Link to comment
Share on other sites

Try this... might make it easier for you

[color=#000000] [color=#0000BB]<?php 

[/color][color=#007700]function [/color][color=#0000BB]example[/color][color=#007700]([/color][color=#0000BB]$params[/color][color=#007700]) { 
   [/color][/color]$params = $params["params"];
[color=#000000][color=#007700]    echo [/color][color=#DD0000]"<pre>"[/color][color=#007700]; 
   print_r($params);[/color][color=#FF8000]
   [/color][color=#007700]echo[/color][color=#DD0000]"</pre>"[/color][color=#007700]; 
} 
[/color][color=#0000BB]add_hook[/color][color=#007700]([/color][color=#DD0000]"AfterModuleCreate"[/color][color=#007700],[/color][color=#0000BB]50[/color][color=#007700],[/color][color=#DD0000]"example"[/color][color=#007700]); 

[/color][color=#0000BB]?>[/color] [/color] 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated