/** * Define how to sort running time column in WP admin. * @param ??? $query I dunno, probably an object or something? */ function sb_meet_time_column_orderby($query) { $orderby = $query->get("orderby"); if ($orderby == "meet_time") { $query->set("meta_key", "meet_start_time"); $query->set("orderby", "meta_value_num"); } }
/** * Parser's core function. * @param ??? $tag ??? * @param ??? $posstart ??? * @return integer new position */ protected function _parse($tag, $posstart) { $checkNextTag = true; // we analyse each part of the string, for ($i = $posstart + 1; $i < $this->end; $i++) { $t =& $this->str[$i]; // is it the escape char ? if ($this->escapeChar != '' && $t === $this->escapeChar) { if ($checkNextTag) { $t = ''; // yes -> let's ignore the tag $checkNextTag = false; } else { // if we are here, this is because the previous part was the escape char $tag->addContent($this->escapeChar); $checkNextTag = true; } // is this a separator ? } elseif ($tag->isCurrentSeparator($t)) { $tag->addSeparator($t); // ??? } elseif ($checkNextTag) { // is there a ended tag if ($tag->endTag == $t && !$tag->isTextLineTag) { return $i; } elseif (!$tag->isOtherTagAllowed()) { $tag->addContent($t); // is there a tag which begin something ? } elseif (isset($this->currentTextLineContainer->allowedTags[$t])) { $newtag = clone $this->currentTextLineContainer->allowedTags[$t]; $i = $this->_parse($newtag, $i); if ($i !== false) { $tag->addContent($newtag->getWikiContent(), $newtag->getContent()); } else { $i = $this->end; $tag->addContent($newtag->getWikiContent(), $newtag->getBogusContent()); } // is there a simple tag ? } elseif (isset($this->simpletags[$t])) { $tag->addContent($t, $this->simpletags[$t]); } else { $tag->addContent($t); } } else { if (isset($this->currentTextLineContainer->allowedTags[$t]) || isset($this->simpletags[$t]) || $tag->endTag == $t) { $tag->addContent($t); } else { $tag->addContent($this->escapeChar . $t); } $checkNextTag = true; } } if (!$tag->isTextLineTag) { //we didn't find the ended tag, error $this->error = true; return false; } else { return $this->end; } }