WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 28 | |
| 29 | $cat_name= wp_specialchars($_POST['cat_name']); |
| 30 | $id_result = $wpdb->get_row("SHOW TABLE STATUS LIKE '$wpdb->categories'"); |
| 31 | $cat_ID = $id_result->Auto_increment; |
| 32 | $category_nicename = sanitize_title($cat_name, $cat_ID); |
| 33 | $category_description = $_POST['category_description']; |
| 34 | $cat = intval($_POST['cat']); |
| 35 | |
| 36 | $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')"); |
| 37 | do_action('add_category', $wpdb->insert_id); |
| 38 | |
| 39 | header('Location: categories.php?message=1#addcat'); |
| 40 | break; |
| 41 | |
| 42 | case 'delete': |
| 43 | |
| 44 | check_admin_referer(); |
| 45 | |
| 46 | $cat_ID = (int) $_GET['cat_ID']; |