Advertisement
alexgieg

Relevanssi taxonomy parents indexing

May 24th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. foreach ($ptagobj as $ptag) {
  2.     if (is_object($ptag)) {
  3.         $tagstr .= $ptag->name . ' ';
  4.     }
  5.     if ("on" == get_option("relevanssi_include_taxonomy_parents")) {
  6.         $taxonomy_parent = $ptag;
  7.         while ($taxonomy_parent->parent && ($taxonomy_parent->parent != $taxonomy_parent->term_id)) {
  8.             $taxonomy_parent = get_term($taxonomy_parent->parent, $taxonomy);
  9.             if (is_object($taxonomy_parent)) {
  10.                 $tagstr .= $taxonomy_parent->name . ' ';
  11.             }
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement