public function getPermalink() { /*$query = get_permalink(Qdmvc_Helper::getPageIdByTemplate('page-templates/service.php')); $query = add_query_arg(array('id' => $this->id, 'title' => $this->name), $query);*/ $query = site_url(sprintf('%s/%s-%s.html', Qdmvc_Helper::sanitize_title_with_dashes($this->getPostCatObj()->title), Qdmvc_Helper::sanitize_title_with_dashes($this->title), $this->id)); return $query; }
public function getPermalink() { //$query = get_permalink(Qdmvc_Helper::getPageIdByTemplate('page-templates/bds-detail.php')); //$query = add_query_arg(array('id' => $this->id), $query); //$query = site_url(sprintf('%s/%s.html', Qdmvc_Helper::sanitize_title_with_dashes($this->name), $this->id)); //return $query; $tmp = site_url(sprintf('%s/%s.html', Qdmvc_Helper::sanitize_title_with_dashes($this->name), $this->id)); return $tmp; }
protected function slug_idOnValidate($field_name) { if ($this->{$field_name} == '' && $this->name != '') { $this->{$field_name} = Qdmvc_Helper::sanitize_title_with_dashes($this->name); $this->pushValidateError($field_name, 'Slug ID tự động lấy từ Name', 'info'); } }