Gossamer Forum
Quote Reply
Help with Hook
    

How do I set $category_id to equal the category_id of the category which was just added, so I can use it in my hook below? Is it something I get from args? Sorry if this sounds like a dumb question.... I know args contains stuff, but just not sure if it has this, and how I get it out of it!Blush

Code:


sub add_category {

# -------------------------------------------------------------------

# This subroutine will get called whenever the hook 'add_category'

# is run. You should call GT::Plugins->action ( STOP ) if you don't

# want the regular code to run, otherwise the code will continue as

# normal.

#

my (@args) = @_;

my $category_id = shift;

#determine directory depth for new category

my $catdepth = &find_depth($category_id);

#update the depth to the categories 'Depth' Column

&update_catdepth ($category_id, $catdepth);

return @args;

}

Last edited by:

sooke: May 14, 2002, 2:01 PM
Subject Author Views Date
Thread Help with Hook Ian 5529 May 14, 2002, 1:59 PM
Post Re: [sooke] Help with Hook
Paul 5384 May 15, 2002, 2:38 AM
Thread Re: [sooke] Help with Hook
yogi 5445 May 15, 2002, 5:04 AM
Post Re: [yogi] Help with Hook
Ian 5421 May 15, 2002, 8:52 AM
Post Re: [yogi] Help with Hook
Ian 5354 May 15, 2002, 10:15 AM
Thread Re: [yogi] Help with Hook
Ian 5433 May 15, 2002, 11:04 AM
Thread Re: [sooke] Help with Hook
Paul 5403 May 15, 2002, 12:26 PM
Thread Re: [Paul] Help with Hook
Ian 5448 May 15, 2002, 12:53 PM
Thread Re: [sooke] Help with Hook
Paul 5368 May 15, 2002, 12:57 PM
Post Re: [Paul] Help with Hook
Ian 5364 May 15, 2002, 1:04 PM
Thread Re: [sooke] Help with Hook
Paul 5410 May 15, 2002, 1:04 PM
Post Re: [Paul] Help with Hook
Ian 5330 May 15, 2002, 1:20 PM
Thread Re: [sooke] Help with Hook
Paul 5360 May 15, 2002, 1:32 PM
Thread Re: [Paul] Help with Hook
Ian 5356 May 15, 2002, 1:36 PM
Post Re: [sooke] Help with Hook
Ian 5326 May 15, 2002, 1:56 PM