Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#26104 closed defect (bug) (invalid)

created_term action hook only passes 1 parameter (should be 3)

Reported by: kiddhustle's profile kiddhustle Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

In the file wp-includes/taxonomy.php - Line: 2209

do_action("created_term", $term_id, $tt_id, $taxonomy);

Shows that the hook callback should expect 3 parameters but I only received 1.

I see these errors:

"PHP message: PHP Warning: Missing argument 2 for wiardweb_created_term()"
"PHP message: PHP Warning: Missing argument 3 for wiardweb_created_term()"

Have attached a sample callback.

Tested using Wordpress 3.7.1

Also the only docs I see relating to this hook is in the wp_insert_term reference...

http://codex.wordpress.org/Function_Reference/wp_insert_term

Attachments (1)

wp_bug__created_term.php (278 bytes) - added by kiddhustle 11 years ago.
Sample action hook callback: created_term

Download all attachments as: .zip

Change History (4)

@kiddhustle
11 years ago

Sample action hook callback: created_term

#1 @nofearinc
11 years ago

You'd need to specify how many parameters are you using, i.e.:

add_action('created_term', 'my_created_term', 10, 3);

Where 10 stands for priority (order of operations) and 3 is the number of arguments.

#2 @nofearinc
11 years ago

  • Keywords close added; needs-patch needs-testing needs-docs removed
  • Resolution set to invalid
  • Status changed from new to closed

#3 @SergeyBiryukov
11 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Severity changed from major to normal
  • Version 3.7.1 deleted
Note: See TracTickets for help on using tickets.