Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_category_description

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
96      
97      if (empty ($category_nicename))
98           $category_nicename = sanitize_title($cat_name);
99      else
100           $category_nicename = sanitize_title($category_nicename);
101      $category_nicename = apply_filters('pre_category_nicename', $category_nicename);
102
103      if (empty ($category_description))
104           $category_description = '';
105      $category_description = apply_filters('pre_category_description', $category_description);
106
107      $category_parent = (int) $category_parent;
108      if (empty ($category_parent))
109           $category_parent = 0;
110
111      if (!$update) {
112           $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent')");
113           $cat_ID = (int) $wpdb->insert_id;
114      } else {