Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // index categories
- if ("on" == get_option("relevanssi_include_cats")) {
- $post_categories = get_the_category($post->ID);
- if (is_array($post_categories)) {
- foreach ($post_categories as $p_cat) {
- $cat_name = apply_filters("single_cat_title", $p_cat->cat_name);
- $cat_tokens = relevanssi_tokenize($cat_name);
- foreach ($cat_tokens as $pcat => $count) {
- if (strlen($pcat) < $min_word_length) continue;
- $n++;
- $wpdb->query("INSERT INTO $relevanssi_table (doc, term, tf, title)
- VALUES ($post->ID, '$pcat', $count, 4)");
- }
- if ("on" == get_option("relevanssi_include_cats_parents")) {
- $cat_parent = $p_cat;
- while ($cat_parent->parent && ($cat_parent->parent != $cat_parent->term_id)) {
- $cat_parent = get_category($cat_parent->parent);
- $cat_parent_name = apply_filters("single_cat_title", $cat_parent->cat_name);
- $cat_parent_tokens = relevanssi_tokenize($cat_parent_name);
- foreach ($cat_parent_tokens as $pcat => $count) {
- if (strlen($pcat) < $min_word_length) continue;
- $n++;
- $wpdb->query("INSERT INTO $relevanssi_table (doc, term, tf, title)
- VALUES ($post->ID, '$pcat', $count, 4)");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement